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: 
Not applicable

List box sort malfunction

Hi,

I'm facing an issue when trying to sort the values in a month list box.
I'm doing the sort based on a field called MONTH_SHORT_NAME which contains values like JAN, FEB...DEC
The object I sort by is MONTH_MONTH_OF_YEAR which is a number from 1 to 12. The sort is working perfectly until I click on one month and the selected value goes to the end of the list. I don't understand why this behavior, considering in the proprieties I choose to sort by the expression MONTH_MONTH_OF_YEAR and not by state.
Please, take a look at the enclosed document.

Do you know why it doesn't keep the sort?

Thanks

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

Better, You could make the Field as Dual(MONTH_SHORT_NAME, MONTH_MONTH_OF_YEAR) and apply sort by Numeric as  ascending.

If your looking a solution to the current approach. then try

Max({1} MONTH_MONTH_OF_YEAR) instead of MONTH_MONTH_OF_YEAR

View solution in original post

4 Replies
Anonymous
Not applicable
Author

Can you change your SORT expression to

 

= Num(MONTH_SHORT_NAME)


Anonymous
Not applicable
Author

I believe that this is occurring because when you make a selection the other months are not selected. Therefore MONTH_MONTH_OF_YEAR is essentially NULL. If you change ascending to descending you see the selected values are now at the top. You could do either of the following:

- Sort by load order. This assumes that the months are loaded in the correct order.

- Load the Months as dual data types where the second parameter is the load order. Then they will sort correctly.

Not applicable
Author

I would recommend trying the dual() function in the script.

In your case e.g.

LOAD

...,

...,

dual(MONTH_SHORT_NAME, MONTH_MONTH_OF_YEAR) as MONTH,

...

etc

In the list box you can then do a numeric sort and it should sort correctly.

CELAMBARASAN
Partner - Champion
Partner - Champion

Better, You could make the Field as Dual(MONTH_SHORT_NAME, MONTH_MONTH_OF_YEAR) and apply sort by Numeric as  ascending.

If your looking a solution to the current approach. then try

Max({1} MONTH_MONTH_OF_YEAR) instead of MONTH_MONTH_OF_YEAR