8 Replies Latest reply on Nov 22, 2016 8:55 AM by Vishal D

    Dynamic Time Axis

    Vishal D

      I want a drop down which will give the user option to change the time slice on x axis

       

      Monthly

      Weekly

      Daily

      Hourly

       

      I have [Order Date]  which has timestamp data type in SAP HANA and I want to show [Sales] based on the option selected in Drop Down

       

      How do I achieve this?

       

      Data

        • 1. Re: Dynamic Time Axis
          Joe Oppelt

          One way is to cre4ate a param with values "hour", "day", "week", "month"

           

          Then create a calc that does this:

           

          DATETRUNC([your param], [Order Date])

           

          You might have to do:

           

          If [your param] = "month" then DATETRUNC('month', [Order Date])

          elseif

          [your param] = "day" then DATETRUNC('day', [Order Date])

          elseif

          ...

          END

           

          Not sure if DATETRUNC will take the param itself as the argument in the first slot.

           

          But that will truncate the date field to your granularity, and you use that calc on your columns shelf.

          1 of 1 people found this helpful
          • 2. Re: Dynamic Time Axis
            Vishal D

            While this helps how do I get agreegated chart?

             

            If user selects 'Weekly' I want agree-gated line chart for Mon to Sunday.

            If user selects 'Hourly' I want agreegated line chart for 0 to 23 hours.

             

            I want something like below.

            • 3. Re: Dynamic Time Axis
              Eric Van Blargan

              I would suggest creating different visuals for each aggregation you are looking for on 4 tabs, and then using a parameter to toggle between them in a fixed container on the dashboard.

               

              Create a parameter with the fields monthly, weekly, hourly, daily

               

              Create a calculation calling your parameter

              IF <Parameter> = 'Monthly' THEN 'Monthly'

              ELSEIF <Parameter> = 'Weekly' THEN 'Weekly'

              ELSEIF <Parameter> = 'Daily' THEN 'Daily'

              ELSEIF <Parameter> = 'Hourly' THEN 'Hourly'

              END

               

              Add this filter to each sheet that corresponds with the time aggregation.

               

              Use a horizontal container on the dashboard and drag the sheets onto it.  Hide the titles and you should be set.

               

              If you can provide a workbook, it may be easier to show you.

              1 of 1 people found this helpful
              • 4. Re: Dynamic Time Axis
                Vishal D

                Eric,

                 

                Attached is the twbx

                 

                1. I have created 4 tabs - Monthly, Weekly, Daily & Hourly
                2. I created the parameter - 'Time Slice'
                3. I also created calculated field 'Time Filter'

                 

                If you could help me placing these tabs on dashboard?

                 

                Please note I want to use automatic layout as this dashboard is going to be used on widescreen monitor, ipad & laptops.

                • 5. Re: Dynamic Time Axis
                  Eric Van Blargan

                  Hi Vishal,

                  See attached.  I am still on Tableau 9.1 so anything later I can't open, I apologize.

                  I did create a sample twbx for you to view.  When it got to the dashboard, i applied a fixed horizontal container to the dashboard, and then hid the titles.

                   

                  Take a look and see if this helps.

                   

                   

                  Eric

                  1 of 1 people found this helpful
                  • 6. Re: Dynamic Time Axis
                    Vishal D

                    Eric,

                     

                    Did you just placed all 3 sheets on top of each other?

                     

                    What was your order of placement

                     

                    Step 1 - New dashboard

                    Step 2 - Drop Monthly sheet?

                    Step 3 - ??

                    • 7. Re: Dynamic Time Axis
                      Eric Van Blargan

                      Yes, that is all that was done. 

                      I created the new dashboard.

                      Deleted the default container and added a new horizontal container.

                      Added the monthly sheet.

                      Dragged the Weekly on top of the monthly.

                      Hid the titles for all of the sheets.

                       

                      Here are all of the sheets added together

                      Before.PNG

                       

                      Here is it after the titles were hidden (what you would see in the workbook)

                      after.PNG

                      1 of 1 people found this helpful