Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

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

Re: List box sort malfunction

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

4 Replies
jaswantc
Contributor II

Re: List box sort malfunction

Can you change your SORT expression to

 

= Num(MONTH_SHORT_NAME)


Employee
Employee

Re: List box sort malfunction

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

Re: List box sort malfunction

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.

Re: List box sort malfunction

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

Community Browser