Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
atsushi_saijo
Creator II
Creator II

Order By trouble: How could we order by 2 columns of numeric columns in Desc?

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:

Error 11.jpg

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.

Error 12.jpg

[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(...).

1 Solution

Accepted Solutions
Anonymous
Not applicable

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

View solution in original post

4 Replies
Anonymous
Not applicable

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

MarcoWedel

Order By Sort_a desc, Sort_b desc


instead of


Order By Sort_a, Sort_b desc desc

atsushi_saijo
Creator II
Creator II
Author

Thanks it works.

atsushi_saijo
Creator II
Creator II
Author

Thanks, it works.