It seems an easy task but I can't fugure it out; I want to filter a report from Now() to Now()-7 ; basically the current week's worth of data.
Assuming data in memory with a date and date time available to use.
Can anyone help me on this?
There is option of function of relative period when you calculate aggregated column, if you want to aggregate something for a relative period, please check if its useful for you.
RelativePeriod operator does not work at the week level, unfortunately.
Hey sam do you know, how the option of _Inferred_ for grouping period it says that it takes the grouping based on data in the report but it never worked for me.
An issue with _Inferred_ is that it will often use an inferred interval period of "day" for the inner interval but the LASR function does not like to process "day" and so the operator returns missing values in most cases.
If your date data item has a format like MMMYYYY, then _Inferred_ should correctly set the inner interval to "Month".
Personally I always set the interval parameters to the period I want rather than using _Inferred_.
Eventually this should work better than it does right now.
The periodic operators do not handle relative dates correctly when the interval is day. Possibly some day processing was supported in earlier releases but it could return bad results. The operators were changed to always return missing values when the interval is day and there is any offset processing to do. I don't remember whether day processing was enabled in any customer-facing release.
Day interval is still fine for operators like Period that do not calculate a difference between dates.
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.