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: 
maxsheva
Creator II
Creator II

Sort first by Field1 and then by Field2

Hi,

How can I make sort first by Field1 and then by Field2?

LOAD * INLINE [

Name, DateEntering, DateGraduation

Name1, 01/02/2010, 01/14/2017

Name2, 01/02/2010, 01/15/2017

Name3, 01/01/2010, 01/01/2017

];


I need first sort by DateEntering and then by DateGraduation.

As a result next


Name, DateEntering, DateGraduation

Name3, 01/01/2010, 01/01/2017

Name1, 01/02/2010, 01/14/2017

Name2, 01/02/2010, 01/15/2017


Forgot to add that I need make it in an object properties.


Thx.



1 Solution

Accepted Solutions
sunny_talwar

Try this:

DateEntering + DateGraduation/1E10

View solution in original post

14 Replies
Anonymous
Not applicable

Max, You want it in a script or an object??

MK_QSL
MVP
MVP

Where you want to sort?

Are you looking to create new field based on sorting these in Back end (script) ?

If yes, provide some more information.

You can do something like

Data:

LOAD * INLINE [

Name, DateEntering, DateGraduation

Name1, 01/02/2010, 01/14/2017

Name2, 01/02/2010, 01/15/2017

Name3, 01/01/2010, 01/01/2017

];

Noconcatenate

New:

Load Name, DateEnterig, DateGraduation Resident Data Order By DateEntering, DateGraduation;

Drop Table Data;

sunny_talwar

Which object is this? Pivot table or straight table?

maxsheva
Creator II
Creator II
Author

I need for straight and for combo chart x values.

Anonymous
Not applicable

Max, You can go to the sort tab and set the priorities of the dimensions in the order you needed.Capture.PNG

rahulpawarb
Specialist III
Specialist III

Hello Max,

Please refer attached sample application.

Regards!

Rahul

maxsheva
Creator II
Creator II
Author

Thank you.

Do you know how to do sort by two expressions in chart on x-Axis ?

rahulpawarb
Specialist III
Specialist III

Hello Max,

I have one question, out of two expression which one will take precedence while performing sorting. Could you please give us the sample sort order required?

BTW, On Sort Tab of object properties window, you can make use of Sort By Expression feature. Please refer attached sample expression.

Please correct me if I misunderstood.

Regards!

Rahul

maxsheva
Creator II
Creator II
Author

Please, look at the attachment qvw file.
You may see Bar Chart where sort is by 'DateEntering' field.

1.jpg

This sort is not quite that I need. Sort order in Chart should be like in Table Box.

First by 'DateEntering' field and second by 'DateGraduation' field.

2.jpg

Thx.