Hi All,
I have a time slider in report. Can it be set to last 2 months dynamically?
Each day when report is open, the time slider should have range of last 3 months including the current date.
Any help or suggestions on this?
Thanks in advance!
Regards,
Abhi
Here is one way to do it.
Create a new calculate item that will convert your date into a number so you can use it to rank by:
Add a name (I used Numerical Date), drag and drop the TreatAs operator under Numeric (advanced) to the Visual Pane and add your Date category (make sure the drop down in the TreatAs equation is set to _Number_).
Click the OK button.
Next we need to change the properties for this new measure. From the Left Pane, select the Data tab. Then select your new measure (in this case I selected Numerical Date). Update the Aggregation to Average and the Format to Numeric.
Add a Slider control to the section. On the Roles tab select your date field for the Measure/Date.
Next, we need to duplicate our Date category so that we can use it to rank on. From the Left pane select the Data tab and then select your Date category. Right click and choose Duplicate Data Item.
You can then rename it or just leave it as is.
Click back onto your Slider and then click the Rank tab.
Select your new Date category from the drop down then click the Add Rank button. Next, select Top Count from the drop down then make sure the radio button is selected next to Count. Then enter 90 in the box (this will give you the last 90 days). For the By: select your Numberical Date measure.
Now only the last 90 days will be available in the slider.
Next, link your slider to any charts you have on the section that you want to filter the date on.
Then you are done.
I hope this helps.
Melanie
How often do you update the data in the report? Is it daily, weekly or monthly?
Melanie
Hi Melanie,
The data for most of the reports refreshes daily.
Regards,
Abhi
Here is one way to do it.
Create a new calculate item that will convert your date into a number so you can use it to rank by:
Add a name (I used Numerical Date), drag and drop the TreatAs operator under Numeric (advanced) to the Visual Pane and add your Date category (make sure the drop down in the TreatAs equation is set to _Number_).
Click the OK button.
Next we need to change the properties for this new measure. From the Left Pane, select the Data tab. Then select your new measure (in this case I selected Numerical Date). Update the Aggregation to Average and the Format to Numeric.
Add a Slider control to the section. On the Roles tab select your date field for the Measure/Date.
Next, we need to duplicate our Date category so that we can use it to rank on. From the Left pane select the Data tab and then select your Date category. Right click and choose Duplicate Data Item.
You can then rename it or just leave it as is.
Click back onto your Slider and then click the Rank tab.
Select your new Date category from the drop down then click the Add Rank button. Next, select Top Count from the drop down then make sure the radio button is selected next to Count. Then enter 90 in the box (this will give you the last 90 days). For the By: select your Numberical Date measure.
Now only the last 90 days will be available in the slider.
Next, link your slider to any charts you have on the section that you want to filter the date on.
Then you are done.
I hope this helps.
Melanie
Hi Melanie,
Thank you so much. Very well explained, and so easy to follow the steps. Yes it does solve the purpose.
This is exactly what Iw as looking for.
Thanks!!
Regards,
Abhi
so glad it work out!
Hi Melanie,
Is it also possible to keep the history in the date slider with the dynamic range for 1month.
For example in image below:
Type A: It has all the dates with only one month of range selected, which should be dynamicaly updated everyday.
Type B: It shows only 1 month of dynamic date range.
It would be great to have the complete date range, so that user by default see one moth of data, but do have the option to go to previous dates.
Thanks!
Regards,
Abhi
I don't believe that would be possible. If I come up with something I'll let you know.
Melanie
Thanks Melanie!
Hi Abhi,
This what you described is exactly what I need.
Do you (or others) already know the solution for it?
Thanks in advance!
It does not seem to update the selection, only the dates that are available on the slider...
Is the slider linked to the other charts?
The slider is in the Report Header. It looks like on the attached picture. The slider shows rolling 60 months but I would like to always SELECT last 6 months
Hello everyone,
Im using SAS VA 7.4 and even though I follow exactly the steps above mentioned by Melanie, I am not observing the same behaviour.
I create a numerical date, called "Date Num"
I then changed "DateNum" to "Numeric" and "Average"
I then created a slider with "Date" as role :
And finally applied the rank on a duplicated "Date(1)" field, COunt 30, by "DateNum" :
As you can see, the slider will consider the last 10 days? from May 19 to May 28 (and not last 30)
Plus, my slider minimal date should be Nov 2017, as you can see when the rank is disabled :
What did I miss ?
thanks
Victor
When you use ranking it pre-filters the data so you will only see the last 30 days in your slider. As to it only showing the last ten days... can you move the slider to include all 30 days then save the report? I believe the next time you or someone else opens the report it will include all 30 days in the filter.
I think I understand what you are trying to accomplish. With 7.4 there might be other features we could use to make this easier. I'll look into it and get back to you.
Melanie
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.