How to: Rank Things Without Using A Rank Table Calculation

We've been learning Table Calculations and the Level of Detail Calculations this week and thus here's how to Rank different things in Tableau without using Rank as a Table Calculation. We will make a chart that shows Top 3 States by Sales within each Region.

Let's start with using Superstore dataset on Tableau. When we open a new sheet, we need to put Region on rows and Sum of Sales on columns. It should look something like this:

Now, we need to add State to rows too and we can sort the sum of sales for each region. It will look something like this: (when we clicked on entire view)

Now, instead of clicking on 'Quick Table Calculation', we need to create a calculated field for an Index Table Calculation, which we will be using instead of rank. Then, we can drag the field to rows. The calculation and the sheet should look something like this.

Now, we need to make sure index restarts at every region. So to do that, we need to right click on index and click on edit the table calculation, and click on Specific Dimensions.

To make sure we are restarting at correct point, we need to deselect whatever we want to restart with and in our case, it is Region. This will make the index restart at every region from the beginning.

For the final step, we need to control drag index into filters card and select numbers 1,2 and 3 as we want to see top 3 states by sales within each region.

And voila!

This is the final result:

Author:
Gerda Staurylaite
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2024 The Information Lab