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 Super FREQ
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 Super FREQ

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 Super FREQ

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 Super FREQ
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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

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
  • 764 views
  • 3 likes
  • 2 in conversation