Exploring, modeling, predicting and reporting with SAS Visual Analytics and SAS Visual Statistics

Time slider with dynamic range for last 2 months

Accepted Solution Solved
Reply
Contributor
Posts: 31
Accepted Solution

Time slider with dynamic range for last 2 months

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


Accepted Solutions
Solution
‎07-06-2016 10:16 AM
SAS Employee
Posts: 13

Re: Time slider with dynamic range for last 2 months

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


All Replies
SAS Employee
Posts: 13

Re: Time slider with dynamic range for last 2 months

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

 

Melanie

Contributor
Posts: 31

Re: Time slider with dynamic range for last 2 months

Hi Melanie,

The data for most of the reports refreshes daily.

 

Regards,

Abhi

Solution
‎07-06-2016 10:16 AM
SAS Employee
Posts: 13

Re: Time slider with dynamic range for last 2 months

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

 

Contributor
Posts: 31

Re: Time slider with dynamic range for last 2 months

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

 

SAS Employee
Posts: 13

Re: Time slider with dynamic range for last 2 months

so glad it work out!

Contributor
Posts: 31

Re: Time slider with dynamic range for last 2 months

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

SAS Employee
Posts: 13

Re: Time slider with dynamic range for last 2 months

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

 

Melanie

Contributor
Posts: 31

Re: Time slider with dynamic range for last 2 months

Thanks Melanie!

Occasional Contributor
Posts: 11

Re: Time slider with dynamic range for last 2 months

Hi Abhi,

 

This what you described is exactly what I need.

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

 

Thanks in advance!

Occasional Contributor
Posts: 5

Re: Time slider with dynamic range for last 2 months

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

SAS Employee
Posts: 13

Re: Time slider with dynamic range for last 2 months

Is the slider linked to the other charts?

Occasional Contributor
Posts: 5

Re: Time slider with dynamic range for last 2 months

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
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 12 replies
  • 1362 views
  • 5 likes
  • 4 in conversation