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: 
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Sort dimention values in pivot

Hello,

How could I sort the values in dimension in pivot table?

I would like when filtering in the top see the latest dates.

Thank you

MindaugasBacius_0-1726223256808.png

 

Labels (2)
4 Replies
madelonjansen
Partner Ambassador
Partner Ambassador

You can do this in the Sorting properties (in the chart properties, right hand menu.

Change the sorting for this dimension to custom, and set numeric > descending

anat
Master
Master

In the Pivot Table properties, Under the sort tab:

Select the column which u need to sort,Enable the expression option and put the date field like 

only({1}datefield) then select descending order

tresesco
MVP
MVP

@MindaugasBacius - the listbox/selection sort is by default asc. If you have to make it desc, you can try with dual in the script to give it a false numeric value, like:
Dual(Date, -Date) as NewDate and use it for selection/dimension. That resolves the sort order issue, however, this brings an additional overhead of wrong numeric calculation for dates. To handle that you have to use -Date for any UI calculations.

madelonjansen
Partner Ambassador
Partner Ambassador

I like this solution. To get around the 'wrong' numerical value you could create an additional [DateSort] field, and sort by that field?