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: 
upaliwije
Creator II
Creator II

sorting order

Hi FRiends

I have following pivot table in my QV doc'

Screenshot_1.png

I have derived this TOTAL rows with the help of following calculated dimension

=Pick(Dim, BRANCH, 'TOTAL')

I have sorted branch field  with 'Branch No' in descending order since I want to TOTAL row come to the bottom. However due to this my branch order is shown in descending whereas I want it to be shown in Ascending order with Branch1 being shown in 1st row and Total row to remain as the last row . Can you please advise me how to overcome this  issue.

13 Replies
Kushal_Chawda

try to sort it by NO

=Pick(Dim,NO, 1000)

upaliwije
Creator II
Creator II
Author

Thanks Kushal

It works. Could you explain me how it works please

Kushal_Chawda

In Pick function Pick(Dim, BRANCH, 'TOTAL'), you have two dimension BRANCH and Total. where Total is static

so to sort this dimension Pick(Dim, BRANCH, 'TOTAL') we should have some number associated with it. For Branch we have NO field which has numerical values. For total I assigned static value 1000. I assigned 1000 here because Branch NO has 3 digit values, so number for Total should be greater than Branch NO so that Total can appear last in ascending sort order


So, in this expression Pick(Dim,NO, 1000), NO sorts the Branch and 1000 is greater number which assigns to total.


upaliwije
Creator II
Creator II
Author

Thanks,

Really very helpful