Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am pretty newish to Qlikview and I am trying to custom sort a listbox I created.
Currently the data in the listbox looks like this:
0000-0600
0600-1200
0600-1800 (Officer)
0900-1500
1200-1800
1800-0600 (Officer)
1800-2400
What I want is this:
0000-0600
0600-1200
0900-1500
1200-1800
1800-2400
0600-1800 (Officer)
1800-0600 (Officer)
Any ideas?
Thanks
~Norman Rea
Sort by expression:
=match(only({1} MyField), '0000-0600','0600-1200','0900-1500','1200-1800','1800-2400','0600-1800 (Officer)','1800-0600 (Officer)')
Or first load the field values in the order you want them in a table in the script before loading the main data. If you do that you can sort by Load Order to get the sorting you want.
Hi,
Try numeric sort option of the chart in the chart properties or load order.
Regards
Anand
Norm Rea,
Try coding this in the first sheet of the script editor let it be the first table
[some table name]:
LOAD * INLINE [
NameOfTheListBoxYouWantyToCustomSort
0000-0600
0600-1200
0900-1500
1200-1800
1800-2400
0600-1800 (Officer)
1800-0600 (Officer)
]
;
DROP TABLE [some table name];
should work !
The values are loaded out of order so no load order and with the numeric sort nothing happens. This date comes form an excel table with columns: Member Name, Shift and Crew. The shift is were these values reside.
~Norm
Hi,
Or another option
LOAD * Inline
[ Recs
0000-0600
0600-1200
0600-1800 (Officer)
0900-1500
1200-1800
1800-0600 (Officer)
1800-2400 ];
Go to properties >> Sort >> write expression Len(Recs)
Note:- Assume this is the example and in place of Recs use your fieldname.
Regards
Anand
Problem data can change so it is loaded from and excel sheet.
Close but my 0900-1500 is not in the right place.
Hi,
If this is identified and confirmed the length of records which is numeric is 9 then try the below script
A:
LOAD * Inline
[ Recs
0000-0600
0600-1200
0600-1800 (Officer)
0900-1500
1200-1800
1800-0600 (Officer)
1800-2400 ];
New:
LOAD Recs, RowNo() as Rid Resident A Where Len(Recs) = 9;
Concatenate
LOAD Recs, RowNo() as Rid Resident A Where Len(Recs) > 9;
DROP Table A;
And sort it by Rowid
Regards
Anand
Did you also leave Numeric Value (Ascending) ticked? I've got both selected and it seems to work okay..