Create Trellis Chart in Tableau

As a sales analyst, I analyzed the sales data in my company. In the data, I wanted to compare monthly sales trends for different product sub-categories across five years.

To visualize this data, I created a trellis chart in Tableau for an easy data comparison. In this chart, each panel in the grid represents a specific sub-category and shows its sales performance over time.

In this Tableau tutorial, I will explain the Trellis chart in Tableau and how to use it to visualize the data comparison.

What is a Trellis Chart in Tableau?

In Tableau, a trellis chart is used to display multiple smaller charts or graphs that are arranged in a grid to compare different subsets of data. These smaller charts share the same scale and axes, so it’s easy to compare them side by side. With this data visualization, we can spot patterns, trends, and differences between the grouped data.

Trellis charts are helpful when you want to visualize the same type of data information for different categories. With this, we can avoid showing all data in a single graph or chart, which would make it complex to understand.

Tableau Trellis line charts

Create a Trellis Chart in Tableau

To create the Tableau Trellis chart, we will use the Tableau Superstore dataset. Now, connect the data source with Tableau and follow the steps below to create the Trellis chart.

  1. To define the panel of the chart, create the calculated fields Rows and Columns using the formulas below. After this, right-click on the calculated field and change its type to discrete.
//Columns
(index()-1)%(round(sqrt(size())))

//Rows
int( (index()-1)/(round(sqrt(size()))))
  1. Create a custom date field for Sub-category sales using the Order Date. Click on Order date, and select Create > Custom Date. In the custom date, enter the label as Month, for Details select Months, and click OK.
Tableau Trellis Chart
  1. To create the trellis chart view, add the calculated field Columns to Column and Rows to the Rows shelf. After this, add a custom date Month to the column and Sales to the rows. To represent sales by sub-category, add the sub-category to the details card.
Tableau Trellis line chart
  1. To configure the table calculations, click on the calculated field Column and select Edit Table Calculation. In the table calculation, select Specific Dimension and check Sub-Category and Month, then also Level as Sub-Category.
Create a Custom Trellis Chart in Tableau

In the dimensions, ensure that the Sub-Category dimension is positioned above the Month field.

  1. Configure the table calculation of the Rows in the same way, and ensure the dimension is placed before the date field.
Row formula in Tableau Trellis Chart

On the chart, we can see some uneven data lines and points. It is because of the empty values in the datasource. For example, a product hasn’t had sales in the initial month, so the sales values will be null in those months.

Trellis chart in Tableau
  1. To synchronize the data, press “Ctrl” and drag the custom date Month from the Column to the detail card in the Marks section. After this change, the type of Month in the Column to Attribute.
Trellis group chart in Tableau

With this, lines in each section will show the sub-category sales data in continuous lines and a synchronized way.

Trellis Line Chart in Tableau
  1. To add the label for sub-categories, change the Sub-Category in the Marks section from Detail to Label.
  1. For the alignment of label text, click on the Text card and select Line Ends >Label Start of Line. You can choose the position of the label in the Alignment as Top, Bottom, or Middle.
Alignment in Tableau Trellis Chart

Finally, remove the labels in the columns. For this, right-click on the Columns in the chart and select Hide Field Labels for Columns.

Tableau Trellis chart Format

To remove the headers from X and Y axes click on the axes and uncheck Show header. After this, the final output of the Trellis chart will be displayed as shown below.

Create a Trellis Chart in Tableau

In this Trellis chart, we can view the monthly sales trends over the years for each sub-category.

This way, we can create a Trellis chart in Tableau to visualize the data by displaying multiple smaller charts or graphs arranged in a grid to compare different subsets.

Conclusion

In this Tableau tutorial, we have learned about the Trellis chart and how to create one with the help of the above example. By creating a trellis chart in Tableau, we can break down large datasets into smaller, comparable datasets.

In this chart, by arranging multiple line charts in a grid format, we can easily spot trends, patterns, and differences across categories and regions.

You may like to read:

Agentforce in Salesforce

DOWNLOAD FREE AGENTFORCE EBOOK

Start with AgentForce in Salesforce. Create your first agent and deploy to your Salesforce Org.

Salesforce flows complete guide

FREE SALESFORCE FLOW EBOOK

Learn how to work with flows in Salesforce with 5 different real time examples.