Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I just found an issue when handling 2 array of numeric field to order by. (Because QlikView does not support longer numeric, we had to separate timestamp part and mili-second part, and sort using both.)
How could we order by 2 columns of numeric columns in Desc?
In below example, if we Order By Sort_a desc, it produces:
However, if we do Order By Sort_a, Sort_b desc, QlikView sort it firstly by Sort_a, then re-sort by Sort_b in asc.
[Test Data]
Condition: Load * Inline [
Sort_a,Sort_b,V,Row
20150121081635,7230000,A,1
20140213083241,6180000,A,2
];
NoConcatenate
Result: Load *, RowNo() Resident Condition Order By Sort_a, Sort_b desc desc; Drop Table Condition;
[Background]
Often we ought to select only latest value per xxx (something). We order by timestamp, then group by, by having FirstValue(...).
Hi,
Try:
Condition:
Load * Inline
[
Sort_a,Sort_b,V,Row
20150121081635,7230000,A,1
20140213083241,6180000,A,2
];
NoConcatenate
Result:
Load *,
RowNo()
Resident Condition
Order By Sort_a desc, Sort_b desc;
Drop Table Condition;
Regards
Neetha
Hi,
Try:
Condition:
Load * Inline
[
Sort_a,Sort_b,V,Row
20150121081635,7230000,A,1
20140213083241,6180000,A,2
];
NoConcatenate
Result:
Load *,
RowNo()
Resident Condition
Order By Sort_a desc, Sort_b desc;
Drop Table Condition;
Regards
Neetha
Order By Sort_a desc, Sort_b desc
instead of
Order By Sort_a, Sort_b desc desc
Thanks it works.
Thanks, it works.