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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

Sort the values

Hello
got the dimension as seen below 
these values got related numeric values in another dimension
is there a way to sort the values by the numeric dimension when the user selects the values from the upper filter bar?

ali_hijazi_0-1777879070382.png

 

I can walk on water when it freezes
Labels (3)
2 Replies
priscilarubim
Partner - Contributor III
Partner - Contributor III

If your numeric dimension is called "MovementSortOrder" for exemple, you can solve this in the Filter pane / Listbox properties in Qlik Sense / Qlik Cloud:

  1. Select the filter object (Movement)
  2. In the properties panel on the right, go to Sorting
  3. Turn off Auto sorting
  4. Uncheck "Sort by alphabetical"
  5. Check "Sort by expression" and use an expression like:
=MovementSortOrder

 

alexquimu
Partner - Contributor III
Partner - Contributor III

Hey @ali_hijazi,

If you need the selections sorted specifically within the Filter Pane object, @priscilarubim's  approach is the way to go.

However, if you are trying to control the sort order in the Top Selection Bar, it’s a different story. Currently, you can't achieve a custom sort there unless you create a Dual() field in the load script (see my previous post here: Solved: How to sort the selection filter at the top of a s... - Qlik Community - 2517844). If you require the sort order to react to a measure, this won't work since this method is static with the original definitions.

 

A few things I’ve tested but not working:

  • Creating a synthetic dimension with Aggr() Function: Creating a synthetic dimension (master dimension) like Aggr(Dual(field, -sum(amount)), field) sorts correctly within a chart/filter pane, but the Selection Bar still reverts to the original field's default sorting (alphabetically).

  • CalcDim() function: previous approach wrapped in a CalcDim() function (CalcDim - chart function | Qlik Sense on Windows Help), but it's still not working as selections are done in the original fields.

The Dual() method remains the only consistent fix, though as you noted, it can't be assigned to a measure in the UI.

Maybe someone here can help or clarify if I've missed something.

 

Regards,