Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
ricardodeano
New Contributor II

Sort by, then by expression

Good afternoon

Quick question for you, I currently have a simple custom sort by expression that is as follows:

=%DisplayOrder

How would I go about putting in another field and then ordering them independently?

For example, in my head, I would like to do the following custom sort by expression:

=Section DESC THEN BY %DisplayOrder ASC

Is this possible (please note, I am aware the above syntax does not work 🙂 )

Rich

 

Labels (2)
2 Replies
dwforest
Valued Contributor

Re: Sort by, then by expression

In script,

ORDER BY Section DESC, %DisplayOrder

In visualization, maybe making a key. Depends on the value of Section, if numeric, its easy\

key=Hash128(-Section,%DisplayOrder)

If string, you'd have to somehow get the reverse of the String sort order, may a map substituion....

ricardodeano
New Contributor II

Re: Sort by, then by expression

Hello dwforest

I completely forgot to say thank you for this reply, I'm sorry about that!

I ended up creating my own key during the loading of my data which did the job. Thanks for the pointer.