2 Replies Latest reply on Aug 10, 2018 9:04 AM by Simon Runc

    Slider on Period


      Hi All,


      I have a scenario in Tableau to implement a Quarter slider.


      The report itself has to initially filter on the MAX(Order Date) as in quarters. So the max quarter is pulled in the report.


      Now, I will need to implement a slider that will help me toggle to previous 6 quarters. On report opening the initial view should be of latest quarter but user needs to be provided with an option to use a "Quarter" slider to toggle to previous quarters.


      Please refer to the attached workbook and advise on how to implement this solution to the sheet or on a dashboard.




      Simon Runc

        • 1. Re: Slider on Period
          Alexander Dawson

          Create a calculation to determine how many quarters an order is older than the maximum



             DATETRUNC("quarter", [Order Date]),

             DATETRUNC("quarter",{max([Order Date])} )



          Will return 0 when the order is in the max quarter.  1 for previous quarter and so forth. 

          This however will not max out at 6.

          You could create a slider filter control out of this and default it to 0.


          To limit it to 6 there are a couple options.  The first that comes to mind is to create another filter which is not customizable by the end user and boolean such as


          DATETRUNC("quarter", [Order Date]),

          datetrunc("quarter",{max([Order Date])} )

          ) < 7

          Do not create a control, but filter that to return only true values.


          Not knowing when the most recent order is limits any sort of high level date filter.  If you know you're always going to have orders then you can set Order Date > last 6 quarters.


          Hope that helps

          • 2. Re: Slider on Period
            Simon Runc

            So I think this will do the trick...


            First I created a dynamic Quarter Index, which counts back from latest quarter (so zero is lastest quarter, -1 is the next one...and so on)


            [Quarter Index]

            DATEDIFF('quarter',[Order Date], {MAX([Order Date])})*-1


            We can then bring this onto the filter shelf and select 0 to -5


            Then we can bring the Quarter onto the Filter shelf, and use the "filter to latest date value...."



            Expose it, and set to relevant values only...and then change to a slider.


            Hope that helps