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: 
anushree1
Specialist II
Specialist II

Sorting on Pivot based on variable

Hi,

I have a requirement wherein the Pivot in use has 2 dimensions and 3 Expressions.

I have a button variable which helps in Sorting the Chart based on Selection So when Button 1 is clicked it sorts the Chart on 1st Expression Sales Descending and Button 2 it sorts Descending on Expression Growth and Button 3 it sorts  Descending on Expression Growth %. So far its working fine ,now I would like to add button 4 which is the default and must sort ascending on Year Dimension which is the Second Dimension in the chart .

But the sort order can either be ascending or descending on any chart.

So can anyone help me with work around for this

4 Replies
Anil_Babu_Samineni

Try for 4th button like

Aggr(Sum(Sales), (NUMERIC), ASC)

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
anushree1
Specialist II
Specialist II
Author

It is not working , i am having 2 dimensions and i passed both of them in aggr and tried but it is giving weird sorted results

anushree1
Specialist II
Specialist II
Author

also my second dim is like: AGGR(DUAL($(=Period),RowNo(TOTAL)),Div,$(=Period))

So in the sort I have used  AGGR(DUAL($(=Period),RowNo(TOTAL)),Div,$(=Period),ASC)

anushree1
Specialist II
Specialist II
Author

@kaushiknsolanki , @Vegar .

Could you please suggest on this