Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sort monthname listbox

Hi,

I'm trying to sort a listbox with monthname so that the order will be Jan, Feb, Mar ...

I also want to keep this sorting even if the user selects a few months.

A demo app with the functionality can be found here: QlikView

I've used an inline table with the monthname and the sort order

Join(DIM_Time)

MonthSorting:

LOAD * INLINE

[

MonthName, Sort order

JAN, 1

FEB, 2

MAR, 3f

Then I uncheck the state option under Properties -> Sort for the listbox and select Expression =[Sort order]

This works fine until a month is selected. Then the list will move the selected months to the end of the listbox. How can I avoid this?

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Try sorting by this expression: only({1}[Sort order])

To explain, if you select some months only sort order of the selected months are used in the expression. For the other months the sort order is null so those are shown first. The {1} means that selections are disregarded so the sort order value of all months are used for the sorting expression.


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

Try sorting by this expression: only({1}[Sort order])

To explain, if you select some months only sort order of the selected months are used in the expression. For the other months the sort order is null so those are shown first. The {1} means that selections are disregarded so the sort order value of all months are used for the sorting expression.


talk is cheap, supply exceeds demand
Not applicable
Author

That worked great!

Also, thank you for the explanation!