Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
hopkinsc
Partner - Specialist III
Partner - Specialist III

How do i keep a list box alphabetical but have a 'No Selection' at the top?

Hi, i have a list box with several names in it. It is currently sorted alphabetically (which i want to keep) but i also have a 'No Selection' Name in the list which is currently in the middle (as it is sorted alphabeltically). i want it at the top but then the rest remain alphabetically.Can anyone help me please?

1 Solution

Accepted Solutions
kji
Employee
Employee

You can achieve any kind of sort order by using Load Ordersort, this does however require that you specify the sort order in a single column table at the start of the script, or can control the order in which values are read.

View solution in original post

7 Replies
kji
Employee
Employee

You can achieve any kind of sort order by using Load Ordersort, this does however require that you specify the sort order in a single column table at the start of the script, or can control the order in which values are read.

Not applicable

Hi,

There is a solution that is not so "elegant" but is really easy to be achieved - instead of "No Selection" try putting "_No Selection_" or "~No Selection~" as field value, so it starts with a symbol. Thus when sorted the column all "~No Selection~" fields will be at the top.

Best,

Maya

prieper
Master II
Master II

Am not sure on the sense of 'No Selection' within the names, but give it a try and enter under Sorting the fllwg expression

IF(Name = 'No Selection', 0, RANK(Name))


HTH
Peter

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

thanks everyone for your replies. Peter, that didnt seem to do anything??

prieper
Master II
Master II

You eventually have to turn off other sortings, see the attached file

HTH
Peter

Not applicable

To make Maya's suggestion a little more elegant:

in the beginning of the script, try adding

'

Set HidePrefix = '_';

'

Or whatever symbol you are going to use as a prefix. That way, QlikView will nog display it in charts/tables/... but it will act like it is there (in sorting tables alphabetically)

Regards,

Yves.

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Thanks for all your replies everyone. got it working now 🙂