EDUCBA Logo

EDUCBA

MENUMENU
  • Explore
    • EDUCBA Pro
    • PRO Bundles
    • All Courses
    • All Specializations
  • Blog
  • Enterprise
  • Free Courses
  • All Courses
  • All Specializations
  • Log in
  • Sign Up
Home Data Science Data Science Tutorials Tableau Tutorial Hierarchy in Tableau
 

Hierarchy in Tableau

Priya Pedamkar
Article byPriya Pedamkar

Updated March 23, 2023

Hierarchy in Tableau

 

 

Introduction to Hierarchy in Tableau

The hierarchy in Tableau is an arrangement where entities are presented at various levels. So, there’s an entity or dimension under which there are further entities present as levels. In Tableau, we can create hierarchies by bringing one dimension as a level under the principle dimension. The main dimension is the one over which we create the hierarchy. When it comes to analysis, the concept of hierarchies proves handy, as we don’t have to bring all the dimensions separately into analysis. Having meaningful hierarchies in the analysis is thus useful as we can expand from and contract to the main dimension as needed.

Watch our Demo Courses and Videos

Valuation, Hadoop, Excel, Mobile Apps, Web Development & many more.

Creating and Removing Hierarchies in Tableau

In the following section, we shall see how to create, use and remove hierarchies. Before creating hierarchies it must be ensured that the intended hierarchies are meaningful in nature. For this demonstration, we are using the Distribution Unit Volume dataset. The dataset contains volume distributed for a product by distribution units. Important dimensions in the dataset are Region, Distribution Unit, City, DU Code, and Mode while Distribution Volume is the measure.

Here we’ll define a hierarchy for geographical dimensions which are Region, Distribution Unit, and City. Region is the largest unit followed by the Distribution Unit which is followed by City. The city has been represented in the form of codes.

Creating Hierarchy

Let’s proceed to understand how to create hierarchies in Tableau in order to accomplish the above task.

1. First, load the dataset into Tableau. For that click on “New Data Source” under the Data tab. Alternatively, click on “Connect to Data”.

Hierarchy in Tableau 1

2. In the section that pops-up, select the requisite data source type. In this case, it is MS Excel, so we selected Microsoft Excel.

Hierarchy in Tableau 2

3. We can visualize the loaded data in the “Data Source” tab. Examine the data prior to proceeding to analysis. The data must be intact for correct results.

Hierarchy in Tableau 3

4. Moving to the sheet tab, we can find the dimensions and the measure present in the requisite sections.

Hierarchy in Tableau 4

5. We want to create Region -> Distribution Unit -> City hierarchy. In order to create this hierarchy, click on the drop-down menu of the Region dimension. From the menu, in the “Hierarchy” option, click on the “Create Hierarchy” option.

Hierarchy in Tableau 5

6. Following the above procedure generates a simple dialogue box for naming the hierarchy. We will name it as Region which is as shown as follows. Once naming is done, click on Ok.

Hierarchy in Tableau 6

7. The newly created hierarchy appears under Region dimension as can be seen in the below image. Note, now there exists only one level which is nothing but the one represented by the dimension over which the hierarchy has been created.

Hierarchy in Tableau 7

8. The next level in the intended hierarchy is the Distribution Unit. So, we need to add this dimension to the next level. For that, in the drop-down menu of the dimension “Distribution Unit”, click on the “Hierarchy” option. Now, here, two options will appear viz. “Add to Hierarchy” and “Create Hierarchy”. We have already created a hierarchy into which we just want to add the dimension Distribution Unit. So, in the “Hierarchy” option, click on “Add to Hierarchy”, and select “Region”.

Hierarchy 8

9. The above steps lead to the creation of the second level in the hierarchy Region. This is as shown by the following image.

Hierarchy 9

10. Now, following the same procedure as described in the preceding part, we shall add City dimension as the third level in the hierarchy as shown below.

Hierarchy 10

11. The above steps lead to the creation of the third level in the hierarchy which is City as highlighted below.

Hierarchy 11

12. Now that hierarchies have been created, we shall use them in analysis. Drag the Region dimension over which hierarchies were created into Columns Region and measure Sales in Row. We get the following vertical graph.

Hierarchy in Tableau 12

13. The following image gives a closer look into Region dimension which contains hierarchies. Notice, a plus symbol appears which means the dimension contains hierarchies. In order to expand the hierarchies, click on the plus symbol.

Hierarchy in Tableau 13

14. For better analysis, we will convert the vertical graph into a horizontal one as shown in the below image.

Hierarchy in Tableau 14

15. When we click on the plus symbol in the Region dimension, the next level appears which, in this case, is the “Distribution Unit”. Now, note that Region has expanded to the next level, so minus appears before the Region dimension, while for level Distribution Unit plus appears, which means that more level(s) is(are) are there.

Hierarchy in Tableau 15

16. Now, as shown in the following image, we first expanded the Distribution Unit level and minus now appears for it. The next level that gets generated is City. Note, for City, there’s no sign either positive or negative, which means that no further level exists. All the three levels in the defined order are there in the Rows region. When we dragged the Distribution Unit over Color in Marks Card, we can see that City got dragged automatically over the Detail section in the Marks Card. This is because of the hierarchy.

img 16

17. The Following screenshot gives us a closer look into the application of hierarchy.

img 17

Removing Hierarchy

18. Now, it is important to note that once the analysis is done or requisite insights have been obtained, it is always good to have the hierarchies removed. How we can accomplish that, let’s see. Remove the hierarchy in order, so, click on the drop-down menu of City, then in “Hierarchy” click on “Remove from Hierarchy”. This has been illustrated in the below screenshot.

img 18

19. In the below screenshot we can see that City dimension no more appears in the Region hierarchy.

img 19

20. Following the same steps as above, remove the dimension “Distribution Unit” from the hierarchy.

img 20

21. Similarly, we remove Region dimension too over which only we had created the hierarchy. Note that the analysis remains intact. This is because the hierarchy has been removed and not the dimensions. And this is shown by the disappearance of the plus and minus symbols from the dimensions in the Rows region.

eg 21

Conclusion

Having hierarchies containing the desired number of levels representing requisite dimensions is always helpful. Hierarchies are a very powerful tool as they enable strong view-level analysis without actually affecting the original dataset. In Tableau, using hierarchies, one can drill-down data as needed. This proves quite useful especially in situations involving complex problems.

Recommended Articles

This is a guide to Hierarchy in Tableau. Here we discuss how to create, use and remove hierarchy in tableau. You may also look at the following articles to learn more –

  1. Hierarchical Clustering Algorithm
  2. Hierarchical Clustering Analysis
  3. Hierarchical Clustering in R
  4. Hierarchical Database Model
  5. Complete Guide to Concatenate in Tableau
  6. Different Concepts of Tableau Action Filter
Primary Sidebar
Footer
Follow us!
  • EDUCBA FacebookEDUCBA TwitterEDUCBA LinkedINEDUCBA Instagram
  • EDUCBA YoutubeEDUCBA CourseraEDUCBA Udemy
APPS
EDUCBA Android AppEDUCBA iOS App
Blog
  • Blog
  • Free Tutorials
  • About us
  • Contact us
  • Log in
Courses
  • Enterprise Solutions
  • Free Courses
  • Explore Programs
  • All Courses
  • All in One Bundles
  • Sign up
Email
  • [email protected]

ISO 10004:2018 & ISO 9001:2015 Certified

© 2025 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more

EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

By continuing above step, you agree to our Terms of Use and Privacy Policy.
*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA Login

Forgot Password?

🚀 Limited Time Offer! - 🎁 ENROLL NOW