3 Replies Latest reply: Nov 5, 2014 2:56 PM by Manish Kachhia

# Second Dimension Sort w/ Expression

Hello,

My goal is to sort a pivot table based on two dimensions, first Dim3 then by Dim2 in ascending order.  I don't understand why the expression is sorted incorrectly relative to the second dimension.  The sort is based on the expression, which includes set analysis.  You'll see the Simple chart contains no set analysis and appears to sort correctly.

Notice in the highlighted region on the Set Analysis chart how the order of the expression is {4.5,12.2,14.2,17.1,26.4,20.1}.  I expect to see {4.5,12.2,14.2,17.1,20.1,26.4}.

The expression in the Set Analysis chart is: Sum({\$<Expression3={"<=.5"}>}Expression3)

The sort is based on the same expression for both dimensions:

Does someone know why the pivot table is not sorting correctly?  Is there a way to correct this?  I appreciate any feedback!  I've attached the example qvw to this post.

• ###### Re: Second Dimension Sort w/ Expression

Like this?

There is a difference between Pivot Table and Straight Table Sorting...

In Pivot Table, You need to sort by First Dimension and then 2nd Dimension....

you have to sort it first according to the first dimension, then according to the next, etc. You cannot sort it any way you want.

• ###### Re: Second Dimension Sort w/ Expression

Manish,

Thank you for your response.  I will mark your response as the correct answer because you found a fix to my sorting issue.

I do not fully understand your response.  In my original example I did sort by the first dimension and then the second dimension.  Both sorts used the same expression, but they had sorting applied in that order.  The difference you pointed out is the first dimension needs to sorted by the Y-value.

Do you know what about the Y-value sort on the first dimension caused the sorting to correct?

Thank you!

• ###### Re: Second Dimension Sort w/ Expression

Provide me your required result in excel... I will check and come back to you soon.