Friday, January 28, 2022

Creating Compact View of a Sparse Table in Tableau

Catherine came to my office asking if we can create a compact version from a sparse table in Tableau, so that the table would look a lot more compact. This allows a succinct view of the table content. It saves screen real estate and makes it easy to read for business audience.

I mocked up her problem and this is something she would like to see:

Of course we can. I remember I did something a few years back. We can use that technique to solve this problem.

The Sparse Table

The sparse table may result from any particular filtering. Here is my example.

To create the sparse table, we first calculated the quarter over quarter (QoQ) sales ratio in the Superstore data set. Then the result is filtered to keep only those that have QoQ above 100%. 
Then place the products (Sub-Category) on the Label card instead the of ratio. And we got the sparse table as shown in the first image above.

Create a Ranking List per Column

Note that the green pill filter (QoQ) is used to filter the table and keep only the items with QoQ >=100%. Then we need to create a unique rank list. Let's name it RankU.
  •     Rank_Unique(QoQ)
Place RankU on the Rows and Sub-Category on the Details card. We get this:
RankU's table calculations have to be set up properly. It includes the calculation of QoQ which is computed along Order Date. RankU is calculated along Sub-Category.
This way, we get the compact table with all the non-null items on top.

Note that QoQ can be replaced by any other calculations of your own choice. QoQ is already an aggregated quantity. If not aggregated, you need to aggregate the measure first with Sum() or others.

Alternative Designs

If you think the above is too complicated, here is an alternative with some compromises in formatting. Just go without RankU. Leave Rows blank. Here is the resulting view.
Note that, in this case, the items are always center-aligned and you can't change the alignment. Maybe this is good enough for you.

Another design is adding some visuals to the straight table, showing relative QoQs.

Feel free to download the demo workbook to further explore. Leave your comments if questions or contact me at twitter @aleksoft.

No comments:

Post a Comment