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: 
edemerdjieva
Partner - Creator
Partner - Creator

Sort list box by expression

Hi all,

I  have a list box which displays a list of weeks for several years. The list is associated with the "Week" dimension. Week is associated with a "day" dimension in the data model (see attached image).

The values are sorted by:

- state: increasing automatic

- expression: =Min(Num(Date)) decreasing

- numeric value : decreasing

 

The problem is that when I make a selection in this list box the sort is no longer respected (see attached image). I would like that the sort be always decreasing no matter a selection or not.

Do you have an idea what's wrong ?

 

Thank you in advance.

 

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Well, since you are using expression for sorting, I guess you have to disregard the selection in that expression, like: 

=Min({1}Num(Date))

View solution in original post

6 Replies
tresesco
MVP
MVP

Uncheck 'State' sort order
edemerdjieva
Partner - Creator
Partner - Creator
Author

@tresesco

It's not working, unfortunately (see image attached).

If I select an old week (and not the last one), there is still the problem with sort.

tresesco
MVP
MVP

Well, since you are using expression for sorting, I guess you have to disregard the selection in that expression, like: 

=Min({1}Num(Date))
edemerdjieva
Partner - Creator
Partner - Creator
Author

Ok, this one worked. By the way, I had to re-check the state in order to have the selected week(s) in the begining of the coloumn. 

I would like to understand why QV ignored previously the sorting ? 

tresesco
MVP
MVP

When you select a value, qlik runs your expression on that selected value(s) only; i.e. - the values beyond selections then become out-of-scope. Effectively this makes qlik sort withing the in-scope (selected) value(s) - and rest are not considered in sort. By using {1}, you force qlik to dis-regard the selections and consider all values as in-scope.

Hope this helps.
edemerdjieva
Partner - Creator
Partner - Creator
Author

It's clear now :).

 

Thank you!