# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Coming Aug. 9: New Simplified Authoring for Qlik Sense SaaS – For Details, CLICK HERE
cancel
Showing results for
Did you mean:
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:

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]

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
Master

Hi,

Try:

Condition:
[
Sort_a,Sort_b,V,Row
20150121081635,7230000,A,1
20140213083241,6180000,A,2
]
;

NoConcatenate

Result:
RowNo()
Resident Condition
Order By Sort_a desc, Sort_b desc;

Drop Table Condition;

Regards

Neetha

4 Replies
Master

Hi,

Try:

Condition:
[
Sort_a,Sort_b,V,Row
20150121081635,7230000,A,1
20140213083241,6180000,A,2
]
;

NoConcatenate

Result:
RowNo()
Resident Condition
Order By Sort_a desc, Sort_b desc;

Drop Table Condition;

Regards

Neetha

MVP

Order By Sort_a desc, Sort_b desc