Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
jblomqvist
Specialist
Specialist

How can I change the sort order of values in this Pivot Table? It uses a Calculated Dimension

Hello,

I have the following results in a Pivot Table:

Pivot table.JPG

You can see the Other dimension value is all over the place.

The ProductName dimension is a calculated dimension with the following expression:

How can I set the sort of ProductName values so that it's all the specific products first and Other is always the last in the list?

Sample app attached.

5 Replies
sunny_talwar

Try this:

Step 1: Sort order expression: (Sorting Descending)

=Match(ProductName, 'Other', ProductName)

Capture.PNG

Step2: Remove check from y-axis sorting on CompanyName tab:

Capture.PNG

And you will get something like this:

Capture.PNG

jblomqvist
Specialist
Specialist
Author

Hi Sunny,

Thanks I forgot to mention, what if I wanted it to sort by the Sales value (Highest to lowest) on the specific products first and then the last value should be Other?

sunny_talwar

If you still want to keep Company name to be in Descending order. You can use this sorting expression for CompanyName:

Aggr(NODISTINCT Sum(LineSalesAmount), CompanyName)

Output:

Capture.PNG

jblomqvist
Specialist
Specialist
Author

Hi Sunny,

Thanks I forgot to mention, what if I wanted it to sort by the Sales value (Highest to lowest) on the specific products first and then the last value should be Other?

sunny_talwar

Looking into it now