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

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

1 ACCEPTED SOLUTION

Accepted Solutions
MelCar
SAS Employee

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:

 

Rolling Date 1.png

 

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_).

 

Date Slider1.png

 

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.

 

Date Slider5.png

 

Add a Slider control to the section.  On the Roles tab select your date field for the Measure/Date.

 

Date Slider2.png

 

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.

 

Date Slider3.png

 

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.

 

Date Slider4.png

 

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.

 

Date Slider6.png

 

Then you are done.

 

I hope this helps.

 

Melanie

 

View solution in original post

17 REPLIES 17
MelCar
SAS Employee

How often do you update the data in the report? Is it daily, weekly or monthly?

 

Melanie

abhilashatiwari
Obsidian | Level 7

Hi Melanie,

The data for most of the reports refreshes daily.

 

Regards,

Abhi

MelCar
SAS Employee

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:

 

Rolling Date 1.png

 

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_).

 

Date Slider1.png

 

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.

 

Date Slider5.png

 

Add a Slider control to the section.  On the Roles tab select your date field for the Measure/Date.

 

Date Slider2.png

 

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.

 

Date Slider3.png

 

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.

 

Date Slider4.png

 

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.

 

Date Slider6.png

 

Then you are done.

 

I hope this helps.

 

Melanie

 

abhilashatiwari
Obsidian | Level 7

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

 

MelCar
SAS Employee

so glad it work out!

abhilashatiwari
Obsidian | Level 7

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.

 

 

TimeSlider.png

 

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

MelCar
SAS Employee

I don't believe that would be possible. If I come up with something I'll let you know.

 

Melanie

abhilashatiwari
Obsidian | Level 7

Thanks Melanie!

PatrickPosthuma
Obsidian | Level 7

Hi Abhi,

 

This what you described is exactly what I need.

Do you (or others) already know the solution for it?

 

Thanks in advance!

Best Regards,
Patrick Posthuma
+31 06 53135462
The Netherlands
Jadwiga
Calcite | Level 5

It does not seem to update the selection, only the dates that are available on the slider...

MelCar
SAS Employee

Is the slider linked to the other charts?

Jadwiga
Calcite | Level 5

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

 


slider.PNG
VictorM
Obsidian | Level 7

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" 

2018-05-31_11-30-07.png

 

I then changed "DateNum" to "Numeric" and "Average"

2018-05-31_11-30-23.png

 

I then created a slider with "Date" as role :

2018-05-31_11-31-24.png

 

And finally applied the rank on a duplicated "Date(1)" field, COunt 30, by "DateNum" :

2018-05-31_11-32-09.png

 

As you can see, the slider will consider the last 10 days? from May 19 to May 28 (and not last 30)

2018-05-31_11-34-57.png

 

Plus, my slider minimal date should be Nov 2017, as you can see when the rank is disabled :

2018-05-31_11-33-38.png

 

What did I miss ?

thanks

Victor

MelCar
SAS Employee

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

sas-innovate-2024.png

📢

ANNOUNCEMENT

The early bird rate has been extended! Register by March 18 for just $695 - $100 off the standard rate.

 

Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 

 

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
  • 17 replies
  • 6955 views
  • 6 likes
  • 7 in conversation