3 Replies Latest reply on Feb 1, 2019 1:25 PM by Pauline Tisseyre

# Sorting a column with multiple dimensions

Hi!

I have set up a table that I would like to sort by Fill Rate YTD. But I have multiple dimensions and I'm not able to sort the entire column in descending order. Any thoughts on how to do it?

Thanks!
Pauline

• ###### 1. Re: Sorting a column with multiple dimensions

Hi Pauline! Good to see you again.

You basically have a level of detail problem. If you set State to sort by the fill rate, it'll calculate that rate for the entire state, then sort. So, to deal with this, I'd recommend creating a calculated field with all the dimensions that define the level of detail:

Sort Dimension

// Combine all of the dimensions that define our level of detail.

[State] + "|" + [Location] + "|" + [Course] + "|" + STR(DAY([Starting Date]))

Then drag that in front of State on the rows shelf. Then right-click and set it to sort descending based on the fill rate:

Should now look like this:

Finally, right-click on that pill and deselect "Show Header"

See attached.

• ###### 2. Re: Sorting a column with multiple dimensions

Pauline,

The easiest temporary solution would be to make the Fill Years measure discrete and place it on the row as first pill. It will sort in the ascending order. To make it sort descending, just edit to pill to multiply by -1.

Following is one way to achieve dynamic sorting, along with dimensions, to add measures to the list, just convert them all to ASCII characters(This eliminates String/Integer error in Tableau calculated fields) in the calculated fields mentioned in the blog.

https://www.clearlyandsimply.com/clearly_and_simply/2011/11/dynamic-sorting-with-tableau.html

• ###### 3. Re: Sorting a column with multiple dimensions

You are the best Ken! Thank you so much for your quick and well detailed answer

Pauline