Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Custom Sort By Expression

Hi. I have a dimension in a pivot table called Label.

The values of the labels are text strings. There are 5 of them.

'Very Big Label'

'Medium Big Label'

'Small Label'

'Default Label'

'Insignificant Label'

The people I am building the report for always want to see the labels in this order. I can't sort by Text, or Load order, or frequency, so I am wondering if I can create a custom expression to sort them in this order. But I am not very good with the expression language. Can anyone help me write an expression which will sort them in the correct way?

Thanks,

-JC

1 Solution

Accepted Solutions
prieper
Master II
Master II

Sort by the Result of the MATCH-function:

MATCH(CustomerRank, 'Very Big Label', 'Medium Big Label', 'Small Label', 'Default Label', 'Insignificant Label')


HTH
Peter

View solution in original post

8 Replies
prieper
Master II
Master II

Sort by the Result of the MATCH-function:

MATCH(CustomerRank, 'Very Big Label', 'Medium Big Label', 'Small Label', 'Default Label', 'Insignificant Label')


HTH
Peter

Not applicable
Author

I am trying to get this to work. In your formula what is CustomerRank?

prieper
Master II
Master II

This should be your fieldname for the grouping of the customers.

++
Peter

Not applicable
Author

The field name with these values is Label. Is that what you mean?

prieper
Master II
Master II

yes!

++
Peter

Not applicable
Author

Hi all,

this Match expression works great to sort my list box content being "red", "yellow", "green".

However, as soon as I select a value, this value is moved to the bottom of the list which is quite confusing for the user. How do I keep it from moving when I select?

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     In sort tab-->uncheck the sort by state option which makes possible or selected values to the top.

Celambarasan

Not applicable
Author

Hi,

somehow I got it to work, but I don't know how. The "sort by state" option is actually disabled at this moment. See below. Perhaps that is triggered by some other setting. But now I know what that option is doing - thanks 🙂

ScreenShot_04 Apr. 13 15.25.jpg