How to Show Top 10 & "Other" in Tableau  

A client recently challenged me with the question, “How could I show a bar chart in Tableau that shows values for the top 10 displayed as 10 individual bars but group all the rest of the values into a single bar called “other”. The idea was to create this:

65-1.png

I’ll be honest, I got stumped trying to solve this. This is the first thing I tried:

65-2.png

This is the right general way to think about the problem but as you can see, Tableau doesn’t want aggregate (SUM([Sales])) and non-aggregate expressions ([State]) mixed together in the same calculation.

All credit goes to my client for solving this (good job John!). He realized the way to get Tableau to allow this was by using a set.

The first step is to create a set based on the State field that contains the top 10 States by Sales.

65-3.png

The next step is to create a calculated field based on that set which shows a state name if it is part of the top 10 and consolidates all other states into a single value.

65-4.png

The last step is to put that new calculated field to use!

65-5.png

Need help with your own Tableau problem? Call John! ;-)

If you need help, I’m always available via office hour.

How I Used My Data & Tableau Skills to Find 100 Silver Coins Last Year

Are football coaches overly reliant on onside kicks?

0