I need to calculate the number of days between today's date (Now operator) and another date (DOI).
I applied Treatas to the DOI and Treatas and DatePart for Now. I created a variable (FLAG - Past year) based on subracting DOI from Now to get the number of days in between.
Then these are the results. You will see the NOW variable in the list table has different values. It should be the same value.
The FLAG - Past year (1) is the number of days between Now and DOI. The values are incorrect.
What's going wrong? Suggestions please.
Hello,
I tried to duplicate your issue and I got REALLY confused... until I realized that I was seeing aggregated values! 🙂
In the options for your list table, enable "Detail data" and your numbers should make sense again.
(ETA: +1 to what @TSBruce said)
Let us know if that helps,
Sam
I suspect your numeric measures are being aggregated in the table. You may try setting the option on the table to display detail data so these values are not aggregated. I am not sure what your end goal is here, but you could also change the aggregation type for NOW to be AVG instead of SUM and that should give you what you expect if the values are being aggregated.
Hello,
I tried to duplicate your issue and I got REALLY confused... until I realized that I was seeing aggregated values! 🙂
In the options for your list table, enable "Detail data" and your numbers should make sense again.
(ETA: +1 to what @TSBruce said)
Let us know if that helps,
Sam
That was it! Thanks.
It worked! Thanks.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.