Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Sort By Expression Not Working

Hi,

I have a question about sorting value by expression in pivot table.

i have a data like this

 

Col1Col2C ol3Col4Col5Total
LocArea11A0122
LocArea11A0210
LocArea11A0315
LocArea12A015
LocArea12A022
LocArea12A038

And I want to Sort Col5 according the total value (descending)

I've try to put expression in sort tab like this:

sort.PNG

And the result of my table is like this:

sort result.PNG

Col4 has two value (1 and 2).

The first one sorted correctly (A01 --> 22,A03 -->15, and A02 --> 10)

But the second one is not correct, the result i expect is (A03-->8, A01 -->5, A02 -->2)

anybody has solution to solve this problem ?

I also attach the sample file.

Thanks in advance.

5 Replies
Anil_Babu_Samineni

How you say second values are not correct, because your input showing same values. Have you checked the cross checking for UAT. Because, for me the values are correct

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

May be try with y-value sort

Capture.PNG

trdandamudi
Master II
Master II

May be as below:

Sort_Order.jpg

Anonymous
Not applicable
Author

Hi, thanks for your idea ?

But can you explain about this expression ?

Sum(Aggr(Sum(Total), Col5, Col4))

How to decide i need to use Aggr function and put Col5 and Col4 as parameter ?

Thanks in advance.