Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sorting a pivot table - or change to straight table - but how?

Hi,

I have to modify an existing pivot table to sort the revenue per customer and month. If I select only one month, it is working:

pivot1.png

If I select more than one month, the revenue is not sorted anymore. How can I achieve this (sample app attached)?

So the goal would be to have for the lastest month (201406) the following order

23.070,04

14.003,29

13.433,09

etc,

pivot2.png


Thanks.

2 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

I hope 201407 is the latest month


Sort by expression will be

For Latest month =Sum({<Month={$(=Max(Month))}>}Revenue)

For First month =Sum({<Month={$(=Min(Month))}>}Revenue)


Hope this helps

christian77
Partner - Specialist
Partner - Specialist

Hi.

To sort all the dimensions in a pivot table you can try adding or operating your expressions, and placing them into the sort by expression box.

(sum({LAST YEAR}revenue)/SUM({THIS YEAR} revenue))-1

Even you can weight them multiplying by some factor.

To sort a pivot table by more than one dimension is something difficult.

In you picture, I see there is a missorder in the first column, then do:

sum({THIS YEAR, min(MONTH) }revenue)  --> (Simplified sintax)

This may help you.