How to Create Hierarchies in Tableau

How to Create Hierarchies in Tableau

3 mins read3.6K Views Comment
clickHere
Vikram
Vikram Singh
Assistant Manager - Content
Updated on Mar 20, 2023 12:28 IST

In this article, we will discuss hierarchies in tableau, how to create and remove hierarchies in tableau with examples.

2022_05_MicrosoftTeams-image-229.jpg

Table of Content

What is Hierarchy in Tableau?

The Hierarchy in Tableau is an arrangement where the entities are presented at various levels.

In common terms, Hierarchy is a system or organization that has many levels from highest to lowest; similarly, in Tableau, we can create hierarchies by bringing one dimension as a level under the principal dimension.

Still confused!!!

So, let’s understand by an example:

Example1:

In the Sample Superstore dataset, the Hierarchy for geographical dimensions is:

  • Country (USA)
  • Region (Centre, East, West, South)
  • State
  • City
  • Postal Code

If you want to deliver any product, then you must have geographical locations.

So, it will be good practice if we drill down the location as the above.

Let’s take another example of Hierarchy from the same sample of Superstore data:

Example2:

We can create the Hierarchy for the order date as follows:

  • Year
  • Quarter
  • Month
  • Day
  • Week Number
  • Weekday

If we use the above Hierarchy, it will be very easy to track the order or shipment.

Must Check: What is Tableau?

Must Check: Tableau Online Courses & Certifications

How to create a Hierarchy in Tableau?

Creating hierarchies in Tableau is very easy, and it can be done in just one step:

  • In the data pane, drag a field and drop it directly onto the another field
    • Create Hierarchy dialog box will appear
    • Enter the Name
    • Click OK

Note: You can also add other fields in the above Hierarchy and then can re-order them as required by simply dragging them to a new position.

Let’s take an example to understand how to create a tableau:

Example 3: We will create a geographical hierarchy using Sample Superstore data as discussed in example 1.

Steps to create Hierarchy

  • Connect to Sample Superstore data
  • In the Data pane, drag a Region, and drop it directly to Country
    • Create Hierarchy dialog box will appear 
    • Change Name to Geographical Location
2022_05_create-hierarchy.jpg
  • In the data pane, a new hierarchy is created, as seen below:
2022_05_drag-and-drop-region-in-country.jpg
  • Drag and Drop State, City, Postal Code to Geographical Location
2022_05_drag-and-drop-region-city-postal-code.jpg
  • Re-order fields in the Hierarchy to the required positions
2022_05_rearrange-the-order.jpg

What Next???

We have created the geographical Hierarchy in the data pane, and now we will add the Hierarchy to the visualization. 

From there, we can quickly drill up or down in the Hierarchy to add or subtract more levels of details.

How to Create Group in Tableau
How to Create Group in Tableau
In this article, we will briefly discuss about groups in tableau, how to create groups and finally what are the differences between tableau groups and tableau sets.
Sort Data in Tableau
Sort Data in Tableau
In this article, we will discuss about sorting and different methods how to sort data in tableau briefly with examples.
Connecting data in Tableau
Connecting data in Tableau
In this article, we discussed connecting data in tableau, how to connect files and servers to a tableau with steps on how to connect excel files, how to connect MySQL...read more

Drill up or down in a Hierarchy

Similar to creating Hierarchy, it is very easy to drill up or down in Tableau during visualizations.

It is as simple as:

  • Clicking the + or  icon on the hierarchy field
    • + for drill-down
    • – for drill-up

Let’s see with an example:

Example 4: We will use the same Hierarchy created in the above example( example 3)

Steps to Drill down:

  • Drag and drop Profit in Column Shelf
  • Drag and Drop Country/Region in Row Shelf
2022_05_drill-up-or-down-country.jpg
  • Click on + icon next to Country/Region field
    • In the row shelf, next to the Country/Region field, you will get Region
2022_05_drill-down-1.jpg
  • Similarly, If you click + icon next to the Region field
    • You will get State field
2022_05_drill-down-2.jpg

Steps to Drill Up:

  • Click on the – icon next to Region
    • State field in visualization is removed
2022_05_drill-down-1.jpg
  • Similarly, if you click  next to Country/Region
    • The Region field in the visualization is removed
2022_05_drill-up-or-down-country.jpg
Tableau Operators: Arithmetic, Comparison and Logical
Tableau Operators: Arithmetic, Comparison and Logical
In this article we will discuss different operators in Tableau like arithmetic, comparison and logical operators.
How to Create Sets in Tableau
How to Create Sets in Tableau
In this article, we will briefly discuss one of the tableau’s most powerful analytic features i.e. sets in tableau and how to create, use and delete them.
Dimension and Measure in Tableau
Dimension and Measure in Tableau
Tableau supports seven different data types and it tableau automatically assigns a data type and role to each column.
In this article, we will discuss one of the important concepts...read more

Remove a Hierarchy

To remove a hierarchy in Tableau:

  • In the data pane
    • Right-click on the hierarchy
    • Select Remove Hierarchy
2022_05_remove-hierarchy.jpg

The field in the Hierarchy is removed from the Hierarchy, and it will disappear from the data pane.

Conclusion

In this article, we have discussed hierarchies in tableau, how to create and remove hierarchies in tableau with examples.

Hope this article will help in your data analysis journey.

Top Trending Articles:

Data Analyst Interview Questions | Data Science Interview Questions | Machine Learning Applications | Big Data vs Machine Learning | Data Scientist vs Data Analyst | How to Become a Data Analyst | Data Science vs. Big Data vs. Data Analytics | What is Data Science | What is a Data Scientist | What is Data Analyst

About the Author
author-image
Vikram Singh
Assistant Manager - Content

Vikram has a Postgraduate degree in Applied Mathematics, with a keen interest in Data Science and Machine Learning. He has experience of 2+ years in content creation in Mathematics, Statistics, Data Science, and Mac... Read Full Bio