BookmarkSubscribeRSS Feed
krishnaavm123
Fluorite | Level 6
Hi ,

I have date variable with date9. Format and it is used as date slider in one of my VA report. How do I find min and max ranges that we selected on date slider I wanted to create two new variable which is from date and to date dynamic way so that I can use these two variables to do another calculation.Thanks in advance
3 REPLIES 3
Stu_SAS
SAS Employee

Hey @krishnaavm123! This is a feature that is coming soon in Viya. You will be able to create parameters that represent the start and end range, then use them in calculations. You will no longer be restricted to assigning a single parameter to a slider, and the slider's range will be dynamically created based on the data item assigned to it. But that's just a small sliver of what you'll soon be able to do with parameters 😉 Stay tuned to What's New in Visual Analytics!

Sam_SAS
SAS Employee

I think the workaround in the current versions would be to use two separate, single-value sliders to pick the starting and ending of the selection.  It is a tricky thing to get working, but I think it should be possible.

 

Sam

HunterT_SAS
SAS Employee

It is tricky as @Sam_SAS notes but it can be done. The overall process would look something like this:

1. Create your slider as normal

2. Create a calculated item using the TreatAs function to convert the Date to a numeric value. This is necessary to make sure parameters get set correctly later.

3. Change the default aggregation of this calculated item to Average instead of the default Sum.

4. Add two drop down lists, both with the same Date item as your slider.

5. For both drop down list options, set it to Required.

6. For both drop down lists, add a new parameter. One parameter is Minimum Date, the other parameter is Maximum Date.

7. For the drop down list that represents Minimum Date, set a Rank with Bottom Count of 1 and the By your Date Numeric calculated item.

8. For the drop down list that represents Maximum Date, set a Rank with Top Count of 1 and By your Date Numeric calculated item.

9. Create a filter interaction from the slider to both drop down lists. 

 

The end result is as you change the slider, the drop down lists get updated to the respective min/max values and get set in the parameters. Then you can use the parameters however you'd like. You can also hide the drop down lists via a precision container if you'd like. 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 3 replies
  • 1147 views
  • 6 likes
  • 4 in conversation