BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
tweehh
SAS Employee

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! 

1 ACCEPTED SOLUTION

Accepted Solutions
Sam_SAS
SAS Employee
The other issue I forgot to mention is that if you make this a calculated item, you need to set an aggregation other than Sum. That is probably why you are getting such large values.

View solution in original post

4 REPLIES 4
Sam_SAS
SAS Employee

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

tweehh
SAS Employee

Thank you for your response!

I created the first filter (see below) on the report but the results are negative.Filter.PNG

TreatAs(_Number_, DatePart(Now())) - TreatAs(_Number_,
'Opened at (Date)'n)

 

Sam_SAS
SAS Employee

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.

Sam_SAS
SAS Employee
The other issue I forgot to mention is that if you make this a calculated item, you need to set an aggregation other than Sum. That is probably why you are getting such large values.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Tips for filtering data sources in SAS Visual Analytics

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.

Discussion stats
  • 4 replies
  • 1410 views
  • 3 likes
  • 2 in conversation