Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
microwin88x
Creator III
Creator III

Custom Sort Order?

Hello,

I have the following table:

ORDERVALUE
01X
02A
03B
04C
05Y
06F
07G

What I need is to SORT the table like this:

ORDERVALUE
01X
02A
04C
05Y
03B
06F
07G

By showing number 03 after 05

Do you know how could I do this?

I used a quick fix by doing the following in the script: IF(ORDER='03','05.5',ORDER) AS ORDER

Then I SORT by Expression with field ORDER ascending (01 - 02 - 04 - 05 - 05.5 - 06 - 07).

Is there any other better way?

Thank you!!!

1 Solution

Accepted Solutions
sunny_talwar

or may be this:

Match(ORDER, '01', '02', '04', '05', '03', '06', '07')

View solution in original post

5 Replies
sunny_talwar

Seems like a good way to handle it. What's the concern here?

microwin88x
Creator III
Creator III
Author

I wanted to know if is there any direct way to use from SORT in Expression instead of touching the script?

sunny_talwar

Have you tried this expression for the sort expression:

IF(ORDER='03','05.5',ORDER)

sunny_talwar

or may be this:

Match(ORDER, '01', '02', '04', '05', '03', '06', '07')

microwin88x
Creator III
Creator III
Author

Thank you!!!