Create a Crosstab Chart in Tableau

A crosstab chart, also known as a contingency table or cross-tabulation, is a statistical tool used to analyze and visualize the relationship between two categorical variables. It is a table that displays the frequency distribution of two variables, showing how different categories of one variable relate to different categories of the other variable.

Suppose we want to analyze the relationship between the level of education (High School, Bachelor’s, Master’s, Ph.D.) and the job type (Manager, Engineer, Sales, Marketing) of employees in a company.

A crosstab chart would display the frequency distribution of employees across different education levels and job types, helping us understand:

  • Which education levels are most common among different job types
  • Which job types are most common among employees with different education levels
  • Any patterns or correlations between education level and job type

Let us see an example to create a Crosstab Chart in Tableau:

To create a crosstab chart, we will get the profit for each segment in each region. This data will be displayed for each year using the Order Date.

We have created a new sheet with the name Crosstab Chart in the same Tableau project Amit_Tableau.twb.

Drag the fields to the respective pane in the:

  1. Order Date dimensionDrag to the Columns shelf
  2. Region dimension: Drag to the  Rows shelf
  3. Segment dimension: Drag to the  Rows shelf
  4. Profit measure: Drag to the Text under the Marks card

After dragging, the following crosstab chart is visible:

1. Create a Crosstab Chart in Tableau

1. Create a Crosstab Chart in Tableau

Edit Table Calculation

Right now, the rows display the profit figures for each region year-wise. Let us set the percentage total of profit in each row.

Right-click on SUM(Profit) and click Add Table Calculation:

2. Add Table Calculations for a field in Tableau

2. Add Table Calculations for a field in Tableau

Under the Calculation Type, set the Percent of Total:

3. Set the Calculation Type to Percent of Total in Tableau Crosstab Chart

3. Set the Calculation Type to Percent of Total in the Tableau Crosstab Chart

Set Table(across) under the Compute Using section:

4. Set Table across for Table Calculation in Tableau Crosstab Chart

4. Set Table across for Table Calculation in Tableau Crosstab Chart

Now, the crosstab chart is created with profit percentage values. Also, a small symbol is visible on the right of SUM(Profit) for calculation:

5. Table Calculation set for Crosstab Chart in Tableau

5. Table Calculation set for Crosstab Chart in Tableau

Keep the mouse cursor on any of the records to get the complete information:

6. Keep the mouse cursor to display the details in Tableau

6. Keep the mouse cursor to display the details in Tableau


If you liked the tutorial, spread the word and share the link and our website Studyopedia with others.


For Videos, Join Our YouTube Channel: Join Now


Read More:

Create a Gantt Chart in Tableau
Create a Waterfall Chart in Tableau
Studyopedia Editorial Staff
contact@studyopedia.com

We work to create programming tutorials for all.

No Comments

Post A Comment

Discover more from Studyopedia

Subscribe now to keep reading and get access to the full archive.

Continue reading