BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
JanNeergaard
Fluorite | Level 6

Hi

 

I have a table that contins a list of repairs recorded over the last 2 years. I am building af repair time KPI based on this list. However the KPI should only reflect the repair time for repairs completed over the last year.

 

Table example

 

Created date  Repair time

1/2/2014  10

1/5/2015 1

1/6/2015 2

 

I want to dynamically filter out the first so that the Created date should by higher than now() - 360 days. How do i do this in SAS VA?

 

Many thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
EWS
Obsidian | Level 7 EWS
Obsidian | Level 7

You can do this by adding a filter as follows on your visual:

 

TreatAs(_Date_,(TreatAs(_Number_,'<<your datetime item>>)/86400)) >= TreatAs(_Date_,((TreatAs(_Number_,Now())/86400)-360))

View solution in original post

2 REPLIES 2
EWS
Obsidian | Level 7 EWS
Obsidian | Level 7

You can do this by adding a filter as follows on your visual:

 

TreatAs(_Date_,(TreatAs(_Number_,'<<your datetime item>>)/86400)) >= TreatAs(_Date_,((TreatAs(_Number_,Now())/86400)-360))

JanNeergaard
Fluorite | Level 6

Worked like a charm. However in my case i had to do this

 

TreatAs(_Date_,(TreatAs(_Number_,'<<your datetime item>>))) >= TreatAs(_Date_,((TreatAs(_Number_,Now())/86400)-36​0))

 

because i only had the date and not the time.

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
  • 2 replies
  • 1043 views
  • 0 likes
  • 2 in conversation