Index Sort Order

Index Sort Order

Sometimes you really need to see the top n values in different categories, which is surprisingly tricky in Tableau! Here’s a quick guide to doing that with index().

sort 6
Finished Product!


sort 2
Step 1: Create an index() calculation


sort 3
Step 2: add your calculation to the view. Make sure to make it discrete, and move it between [Abilities] and [Name]
sort 4
Step 3: Edit Table Calculation – this is where things get tricky!

For Compute Using select Specific Dimensions

For this example, check all field names under Specific Dimensions to avoid partitioning the data. Unchecking [Abilities] at this point will make it a partitioning field, and more importantly NOT an addressing field. So, if the box is unchecked then when the table calc gets to the ‘Sort Order’ field it would ignore [Abilities] in the calculation.

At the level doesn’t matter for this example – leave it set to Deepest.

Restarting Every needs to be set to [Abilities]. You may need to drag Abilities higher in the Specific Dimensions checklist to select it here.

For Sort Order select custom, and then [Ability Score], Sum(), and Descending. This forces index to count starting with the highest Ability Score in each category, instead of the default first record.

sort 5
Almost there! Just uncheck Show Headers for Index and add a Index filter.


sort 6
Finished Product!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s