Contents of this post

As a task at The Data School Down Under, we recreated the charts from the Workout Wednesday. I chose to rebuild this chart by Ann Jackson. The purpose of this blog post is to showcase a bucketing technique that combines smaller bars into an “Other” bar. This exercise utilises the Superstore data from 2019.

Initially looks simple, but there’s some complexity behind it for the finer points

 

Method of Approach

When approaching this WoW (Workout Wednesday) Challenge I firstly observed the chart and noticed the following:

  • Axes in percentage
  • Colours of the bars indicate a set is being used.
  • The box on the top right corner is a parameter.
  • This parameter is also used in the reference line.
  • The title and tooltip of this chart (“Contribution of Sales by State”)
Identify what this chart is showing

The chart shows us what each state contributes to a total. What does this mean for us?

It means we will have to resort to using an LOD expression. In this case we create the calculated field {FIXED: SUM(SALES)}

How to combine the smaller contributions

Combining the smaller states into one “field” (or as Ann Jackson calls it, a bucket) it is as simple as using a calculated field.

I am assuming that there is already a set made with the condition that the Percentage of Total Sales by State >=[Parameter].

Next we create a Calculated Field with the following calculation:

From there we use the newly created calculated field and replace the “State” pill.

And we’ve now combined the categories into a bucket!

BONUS TIP

When your sort your data from ascending, or from descending, that bucket will always adjust along with the sort. But what if you or your client wanted to keep it in place so that the focus could be made on the rest of the bars?

To provide further value to your time, I am going to show you how you can keep that new bucket at the bottom of the chart… using another calculated field!

First we’ll use this calculated field:

We can use 0, or we can use a negative number

 

The 0 (or negative number) keeps that bucket field on the bottom of the axis.

From here we will adjust the Sort options using our new calculated field!

Right click on the pill and go to “Sort”

 

Change the options to the above

 

And now we should have a bar that is fixed to the bottom of the chart whenever you change the parameters!

You can actually find this technique in the Zen master: Tableau Speed Tipping in 2019 Youtube at 49:45 as well.

I hope you enjoyed this post.

If you would like to contact me, please feel free to connect with and message me over at LinkedIn.

Thank you for reading and have a great day!

Andrew Ho
Author: Andrew Ho

Andrew joins The Data School with more than 10 years of extensive customer service experience in hospitality and administration fields, even owning and operating his own coffee shop at one point. Having identified a newfound interest in Tableau, Andrew is now taking his skills into data analytics. Outside of work, Andrew enjoys spending his time pampering his dog and two cats. He enjoys and appreciates all kinds of food, so you can be rest assured that no food will go to waste.