Use Tableau Prep Builder to Easily Aggregate Dates at Different Levels

Aggregating data to different levels of detail, also known as granularity, is one of the most common tasks when preparing data for analysis. When you are joining different datasets together, you can easily make mistakes when not joining datasets of the same granularity. For example, if your dataset has a monthly level of detail and you join to a daily-level dataset, each of those 12 months will be duplicated across the 28 to 31 days in each month. Tableau Prep Builder has a sneaky menu that can make this process much faster.

Our example flow uses the sample Superstore Sales dataset that ships with Tableau Desktop and Prep Builder. I’ve dragged the Orders table onto the white space of the flow, commonly called the Flow pane. This creates the input step called Orders. By clicking on the input step, you will see a + appear—click on the plus sign and then select Aggregate.

Figure 0.

When using an Aggregate step you are reducing the amount of granularity in your dataset. You set the new granularity by specifying the categorical fields that you want to group by. This is where this Shortcut comes in.

If you want to set the granularity of the data to work at a less granular level based on a data field, you might think you need to set that up before ...

Get Use Tableau Prep Builder to Easily Aggregate Dates at Different Levels now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.