Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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}.

overview.png

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

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

Dim3 Sort.png

Dim2 Sort.png

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.

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

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.

View solution in original post

3 Replies
MK_QSL
MVP
MVP

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.

Not applicable
Author

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!

MK_QSL
MVP
MVP

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