Hierarchies are quite special. A hierarchy is a group of 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 (that is, they exist in multiple countries). By creating a hierarchy with a country-level field and a region-level field, there is no more ambiguity.
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, then Tableau automatically selects the YEAR and shows a small + in the pill, on the left-side of its name. This means that the dimension is a parent in a hierarchy where there are children. This is illustrated in the following screenshot:
Once you click on the + icon, the child dimension is added next to the parent, and the + icon switches to a - icon. The child can also be a parent of another dimension, and so on.
That's enough for the theory; let's create a hierarchy and use it. You can reproduce the following example using the Sample - Superstore
dataset:
Products
.Hierarchies are useful and powerful tools. We recommend that you use them when you can. Let's finish this chapter with the final option: creating groups, sets, and bins.
3.17.64.72