Drill Down and Up by Date Inside of a Tableau Line Chart

Data

Drill Down and Up by Date Inside of a Tableau Line Chart

Hierarchies in Tableau are a great way to offer a high-level summary with the option to drill down into the data. For example, in the Sample Superstore extract, you can go from feeling great about Technology sales to worrying about losing money on DFX-8500 printers in seconds!

Superstore 1

Superstore 2

In line charts, you can drill down inside of a date variable by selecting the + but are not given a to return to higher date parts. Currently, the user must hit the back button or edit the pill in the worksheet to return to the original view.

Select +

Below are examples of two workarounds that allow the user to drill down and up inside of a date by using a parameter built using the Sample Superstore extract. Open the attached workbook or open up a new Tableau workbook and connect to the Superstore extract to follow along.

Option 1: Calculated Field

First, create a parameter with variables to represent each of the date parts you want users to be able to select from.

Create a calculated field

Next, create a calculated field that truncates the date variable for the line chart based on the parameter selected.

Truncate date

Use the new Graph Date variable in place of the original Order Date in the line chart and set the displayed date part to day. With this, you can now use the parameter to drill down and up inside of a date range.

Pros:

  • Even if users click on the plus sign at the end of the date axis, the chart stays the same.

Cons:

  • A single date format must be selected to be used across all date parts.
  • You have to find a place for an additional drop-down on the dashboard.

Option 2: Swap Worksheets

Create the Date Detail parameter the same as shown above if not done already. Then, create a worksheet for each date part with the Order Date variable set to match.

Create worksheets

Once there is a worksheet set up for each date part, create a new calculated field to filter which date part is displayed.

Date Detail Filter

In a new dashboard with a Tiled layout, add a horizontal container to the dashboard.

Tiled

Add the first date part worksheet to the container and display the Date Detail parameter. Adjust the Date Detail parameter to the date part of the added worksheet, then go back to the sheet. Place the calculated field Date Detail Filter under Filters and select the parameter value that matches the date part.

Date Detail Filter 

Test that this was done correctly by adjusting the Date Detail parameter and checking if the worksheet goes blank when a different date part is selected. Repeat this for each of the date part worksheets. Once all of worksheets have been added in and are working correctly, hide the titles for the worksheets and add a new title across the top.

Pros:

  • The date format for each date part can be customized.

Cons:

  • This is more complicated than the first option to set up.
  • A small blank space is taken up by each worksheet even when hidden.
  • This can be “broken” by users who click on the + at the end of the date axis.
  • You have to find a place for an additional drop-down on the dashboard.

More About the Author

Kent Sloan

Services Lead
Say Less: How To Ensure Your Tooltips Add Value We’ve all done it. We’ve completely ignored the warning label. You know, the one we probably see everyday: CAUTION: Contents Hot We ...
Visualizing the 2022 Gartner BI Magic Quadrant in Tableau Gartner has released its annual Magic Quadrant report for 2022, and, per tradition, I’ve visualized the report in Tableau. Each ...

See more from this author →

InterWorks uses cookies to allow us to better understand how the site is used. By continuing to use this site, you consent to this policy. Review Policy OK

×

Interworks GmbH
Ratinger Straße 9
40213 Düsseldorf
Germany
Geschäftsführer: Mel Stephenson

Kontaktaufnahme: markus@interworks.eu
Telefon: +49 (0)211 5408 5301

Amtsgericht Düsseldorf HRB 79752
UstldNr: DE 313 353 072

×

Love our blog? You should see our emails. Sign up for our newsletter!