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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sort order of list box

Hi

I have an issue with the sort order of a list box. In a basic example i have a 5 character code the Text sort option is ticked and A-Z selected but the result is not what i would expect. The codes are N02AS. N02D1, N2BCP & N2CTC (note the 2nd character of the first two codes is a Zero)

Qlikview lists them:-

     N02AS

     N2BCP

     N2CTC

     N02D1

Which is not the correct alphabetic order, it would appear that the a zero has been added to the middle to codes to produce the order, which is incorrect.

I can get round this be using a sort Expressions of:-

    

          =(((((ord(mid(LC,1,1))*256)+ord(mid(LC,2,1)))*256+ord(mid(LC,3,1)))*256+ord(mid(LC,4,1)))*256+ord(mid(LC,5,1)))*256

But my question is WHY! and does anyone know of a simpler fix?

Sample fileattached ifyou wantto havea play.....

4 Replies
swuehl
MVP
MVP

Hi Andrew,

it will probably not help you, but you are not alone: community.qlik.com/message/12794

I agree that QlikView should keep an eye on the sorting issues, there are several threads complaining about sorting (mostly when using e.g. pivot tables, so not all about yours).

Interestingly, I just played around with your sample and I now get this sort:

N2BCP
N2CTC
N02D1
N03A

If enabling only text A->Z sort. Not sure why, but definitely not correct.

Stefan

jonathandienst
Partner - Champion III
Partner - Champion III

Andrew

I added an article on my blog about creating custom sort orders using dual values and it might be useful to you.

http://yahqblog.blogspot.com/2011/10/dual-values-for-self-sorting_16.html

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Will qlikview have an update for this? Seems pretty complex to customize and / or sort a listbox.

Anonymous
Not applicable
Author

Hi

     We can sort the fields using as we want in the script.

  You just check the attached qv file and listbox sorting table..

Regards

Ashok