Hi!
I am trying to filter and display the tickets that are 6 months or older since the date those tickets were opened. Any ideas how to do this? Any help would be appreciated!
Hello,
I believe this should be possible but a bit annoying to do.
You can perform math on dates by using the TreatAs operator and remembering that the date values are the number of days since 01JAN1960 (in this case, we don't care when day zero was.)
You can use an expression like this to determine the 'age' of a date value:
TreatAs(_Number_, DatePart(Now())) - TreatAs(_Number_, 'Facility Opening Date'n)
Then you could compare this number to 180 to approximate a six month cutoff.
So your advanced filter expression would look something like this:
( TreatAs(_Number_, DatePart(Now())) - TreatAs(_Number_, 'Facility Opening Date'n) ) >= 180
Let us know if that works,
Sam
Thank you for your response!
I created the first filter (see below) on the report but the results are negative.
TreatAs(_Number_, DatePart(Now())) - TreatAs(_Number_,
'Opened at (Date)'n)
It's a bit unusual that your data item has parentheses in the name. I'm not sure if that could be an issue, or possibly the Opened At column is a datetime value, in which case wrapping in the DatePart() operator should yield the desired result.
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.