databasetableau-desktop

How can I limit the amount of rows returned in my report?


I am building a report in Tableau Desktop that shows user time logs. It only has three rows: LastName, StartTime, and EndTime.

The report is working, but it's very long because it shows each time value for each user...so Bob might have 90 different StartTime and EndTime entries.

Is there a way to only show the very first StartTime and EndTime for each user, but also add a button or control that, when clicked, expands to show ALL the times for that user?

Thanks!


Solution

  • First duplicate your worksheet (tab). Name one worksheet something like Summary and the other something like Detail — by right clicking on the tab to rename.

    Then edit your Summary worksheet and right click on the StartTime pill on whatever shelf you’ve placed it on (probably the Rows shelf). From the context menu, select the MIN() aggregation function from the Measure submenu. This changes your viz from using StartTime as a dimension to using it as a Measure. By default, Tableau will make the MIN(StartTime) measure continuous, green colored, causing values to displayed along an axis. If you prefer to have a column view, simply use the right click menu again to change the field from continuous to discrete (blue).

    Do the same for the StopTime pill.

    Now you should have one row per user, showing simply the first start time and first stop time for that user. That should be a quick high level summary.

    For extra credit, you could add fields to your summary to show the the number of sessions, Count(sessions), and the last start and last stop time. Or with a simple calculated field, the Avg session duration

    For your detail sheet, you are going to want to filter it to a single user or a small group of users. There are several ways to do this, the simplest is to add LastName to the filter shelf and then click show Filter to make it interactive. Alternatively, you can read about Filter Actions and/or Viz in Tooltips — both of which allow you to select rows in one sheet, say your Summary sheet, and then automatically filter and display the corresponding detail sheet.

    That way you can easily drill down to see more detail for selected items. These are very common and useful techniques in Tableau.