Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a list box as follows:
3m printers
5m printers
HE printers
hybrid printers
production above 80 printers
production from 50 printers
I want the list box to be sorted as follows:
HE printers
5m printers
3m printers
hybrid printers
production above 80 printers
production from 50 printers
How I can do that ? I did not find the way to do that through the sort options in the sort tabrow under the List Box properties...
Please help.
Thanks,
dani
Sort by expression:
match(YourField,
'HE printers',
'5m printers',
'3m printers',
'hybrid printers',
'production above 80 printers',
'production from 50 printers')
Sort by expression:
match(YourField,
'HE printers',
'5m printers',
'3m printers',
'hybrid printers',
'production above 80 printers',
'production from 50 printers')
Hi Nicole,
This is what I did but it does not work…
Am I missing anything ?
Thks,dani
You need to put whatever field has those values in the place where I have YourField:
match(YourField,
'HE printers',
'5m printers',
'3m printers',
'hybrid printers',
'production above 80 printers',
'production from 50 printers')
You forgot to put the field name as the first argument in the expression.
HeY Dani,
I think you forgot the field name.
Thanks
AJ
I would suggest using the dual function. Adding an order number to each value. This way sort would be much more efficient with QV.
dual( s , x )
Forced association of an arbitrary string representation s with a given number representation x. In QlikView, when several data items read into one field
have different string representations but the same valid number representation,
they will all share the first string representation encountered. The dual
function is typically used early in the script, before other data is read into
the field concerned, in order to create that first string representation, which
will be shown in list boxes etc.
Example:
load dual ( string,numrep ) as DayOfWeek inline
[ string,numrep
Monday,0
Tuesday,1
Wednesday,2
Thursday,3
Friday,4
Saturday,5
Sunday,6 ];
load Date, weekday(Date) as DayOfWeek from afile.csv;
The script example will generate a field DayOfWeek
with the weekdays written in clear text. QlikView will for all purposes (including sort) regard the field as a numeric field.
Excellent now it works !!!
However when I select a filter, the selection goes to the bottom of the list box… and I want this list box to be fixed whatever value I select from the List Box. Do you know how to do that ?
Thanks !
dani
match(only({1}YourField),
'HE printers',
'5m printers',
'3m printers',
'hybrid printers',
'production above 80 printers',
'production from 50 printers')
Excellent !!!! It works now. Many thanks Nicole !