Hierarchies

Hierarchies are quite special. They regroup multiple Dimensions. However, a Hierarchy doesn't just affect the Data Source, but also the visualization and the way the users can interact with it. A hierarchy creates a relationship between different Dimensions, such as a parent-child relationship.

The dedicated icon for Hierarchies is .

Hierarchies are crucial for geographical roles. If you try to build a visualization in a city level without a hierarchy, lots of cities won't be displayed because their names are ambiguous (they exist in multiple countries). By creating a hierarchy with a country-level field and a region-level field, there is no ambiguity anymore.

Dates, for example, are a hierarchy. A day is included in a week, which is included in a month and a year. If you use a Date in a Worksheet, such as Order Date, Tableau automatically selects the YEAR and shows a small + in the pill, at the left of the name. It means that the Dimension is a parent in a hierarchy and there are children. This is illustrated in the following screenshot:

Once you click on the +, the child is added next to the parent, and the + switched to a - to remove the child. The child can also be a parent of another Dimension, and so on. You can see, in the following screenshot, where the YEAR of Order Date is a parent of the QUARTER, and the QUARTER is a parent of another dimension:

Enough for the theory, let's create a hierarchy and use it. You can reproduce the following example with the Sample - Superstore dataset:

  1. Select the Dimensions you want to combine in a Hierarchy. For this example, select Category and Sub-Category.
  2. Right-click on one of the selected Dimensions and go to Hierarchy, then Create Hierarchy...:
  1. A new window opens asking for the name of the Hierarchy. Let's name it Products.
  1. The Hierarchy is created, and you should see a new icon in your Data pane, with the Category and Sub-Category (in that order) under it. Your Hierarchy should look similar to the following screenshot:
If the order is different, you can easily drag and drop the field to change the order.
  1. Let's add the Product Name in the Hierarchy, at the last position. To do that, you can drag and drop the field under Sub-Category:
  1. Double-click on Category, then on Profit. It creates a simple table. You can see the + next to the Category pill. You can also see the +, when you hover over the values in the visualization:
  1. Click on +. Tableau automatically adds the child, Sub-Category. From here, you can go deeper with + or remove Sub-Category with -. Here's the final result:

Hierarchies are a useful and powerful tool. Use them when you can! Let's finish this chapter with the last option: creating Groups, Sets, and Bins.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.162.51