How to Create Hierarchies in Tableau
In this article, we will discuss hierarchies in tableau, how to create and remove hierarchies in tableau with examples.
Table of Content
Best-suited Tableau courses for you
Learn Tableau with these high-rated online courses
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
- In the data pane, a new hierarchy is created, as seen below:
- Drag and Drop State, City, Postal Code to Geographical Location
- Re-order fields in the Hierarchy to the required positions
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.
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
- Click on + icon next to Country/Region field
- In the row shelf, next to the Country/Region field, you will get Region
- Similarly, If you click + icon next to the Region field
- You will get State field
Steps to Drill Up:
- Click on the โ icon next to Region
- State field in visualization is removed
- Similarly, if you click โ next to Country/Region
- The Region field in the visualization is removed
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
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
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