Select Page

In this blog, I’m going to describe how to create small multiple calendars in Tableau. A small multiple is a data visualization that consists of multiple charts arranged in a grid. This makes it easy to compare the entire data. They are known as the trellis, lattice, grid, and panel charts. A workout calendar will be used as an example, which is based on WOW2020 Week 42: Can you build a Strava Workout Calendar? In addition, I will show how to add a text box to each small calendar by applying the dual axis.

### Introduction to the Sample Data

You can download the data from here.

##### a) Calendar

It is included in all the date data from 2014 to 2021.

Figure 1. Calendar Data

##### b) Activities Summary

It contains the training activities details.

Figure 2. Activities Data

##### c) Data Blending

You may confuse about why we would need the calendar data. Since I want to display days with zero hours, there are days that the person did not exercise. To do that, we can use Tableau’s data blending to create connections between Calendar data and Activities Summary data. You can click the <Data> in the menu and select <Edit Blend Relationships..> to edit data blending. Cause we will use the calendar data as the main axis, we should set it as the primary data source. In this blog, we just need to connect them by the following dimensions.

Figure 3. Data Blending

### The steps to create a small multiple in Tableau

We want to arrange the 12 months in the shape of [4,3] (4 columns and 3 rows). How can we do that? You can imagine you created two axes on Tableau and put the months into the corresponding places.

Figure 4. Small Multiple Sample

##### a) Create a calculated field for the column divider

(MONTH([Date])-1) % 4

JAN: (1-1) % 4 = 0

FEB: (2-1) % 4 = 1

MAY: (5-1) % 4 = 0

Figure 5. Column Divider

##### b) Create a calculated field for the Row divider

INT((MONTH([Date])-1) / 4)

JAN: INT ((1-1) / 4) = 0

FEB: INT ((2-1) / 4) = 0

MAY: INT ((5-1) / 4) = 1

Figure 6. Row Divider

##### c) Put the fields on the shelves
1. Move the <Month Column Divider> on the column shelf.
2. Drag the <Month Row Divider> on the row shelf.
3. Since I want to show all day’s training each month, we should put the discrete <DAY> field on the column shelf and convert it into a continuous one.
4. To show the days with zero hours, put the YEAR and MONTH of <Date> in the details.
5. Drop the <Hour> field on the row shelf.
6. Select the Bar type and make the size smaller.

Figure 7. Calculated Field for Hours

Figure 8. Small Multiple

### The steps to add text on each small charts

Now, we get all the calendars arranged in the right place. However, there is a question. If we want to put a text box on each small chart to illustrate their month and the sum of hours, how to do that? The answer is to apply the dual axis in Tableau.

Figure 9. Text Box Sample

##### a) Calculate the height of the text box

Since we want to put the text box in the upper right place, we can set the max hour across all the months as height.

Figure 10. Calculated Field for Height

##### b) Set the location of the text box

Create a calculated field and write the below statement. When Day is 27, set the height as the max hour across all the months. Since we want to make the box a bit higher than the max month, we can set an offset such as 2 to make it higher.

Figure 11. Calculated Field for Text Box Location

##### c) Edit the text

In this example, we want to show the month and the sum of hours each month. Then we create two calculated fields for preparation.

Figure 12. Calculated Field for Month Name

Figure 13. Calculated Field for Hours per Month

##### d) Apply the Dual Axis
1. Put the <Upper Right Location> field on the row shelf.
2. Drag and drop the prepared fields on the text card.
3. Change the type to Text.
4. Open the table calculation and tick all dimensions.
5. Right-click the field and select dual axis.
6. Synchronize the axis and hide the NULL indicator.

GIF 1. Final Operation – First Step

GIF 2. Final Operation – Second Step

The last thing is to do the formatting job. You can do whatever you want. You can find more details on my Dashboard.

Figure 14. Final Chart

If there are any problems, please feel free to point them out. Besides, you can reach out to me on LinkedIn. I will try my best to answer your questions about Tableau or Alteryx.

##### Author: Joe Chan

Joe has an IT background with a master's degree in UNSW, majoring in AI and Data Science. During his studies, he realized Data is one of the most valuable assets a business can have and potentially has a tremendous impact on its long-term success. After graduation, his desire to level up his data analytics skills led him to join The Data School. He is interested in Data Wrangling, Data Visualization, and Machine Learning, eager to be a great Data Analyst to help businesses grow.