Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
smilingjohn
Specialist
Specialist

Sort

Hi All,

How to sort using the expression

iam using the below expression to sort accrodingly but i dont see the proper result , can someone help me with this

if(Priority='Blocker',1, if(Priority=' Critical',2, if(Priority=' High',3,if(Priority=' Medium',4,if(Priority=' Low',5,'Unassigned')))))

And this is what iam getting the output

Priority.PNG

Thanks in Advance

1 Solution

Accepted Solutions
Siva_Sankar
Master II
Master II

use below in your expression

=Match(Priority,'Blocker','Critical','High','Medium','Low','Unassigned')


for other methods of custom sorting refer here http://www.qlikfix.com/2010/10/25/creating-a-custom-sort-order/


Siva

View solution in original post

4 Replies
avinashelite

Add the expression in the sort >Expression > Increasing order >Number and uncheck rest

smilingjohn
Specialist
Specialist
Author

Hi Avinash,

I dont see that increasing order in my list box propertiese

this is what i have Listboxt propertiese.PNG

Siva_Sankar
Master II
Master II

use below in your expression

=Match(Priority,'Blocker','Critical','High','Medium','Low','Unassigned')


for other methods of custom sorting refer here http://www.qlikfix.com/2010/10/25/creating-a-custom-sort-order/


Siva

tresesco
MVP
MVP

I see a space before your comparison strings. That could be causing the issue. Try removing them like:

if(Priority='Blocker',1, if(Priority='Critical',2, if(Priority='High',3,if(Priority='Medium',4,if(Priority='Low',5,'Unassigned')))))


Note: Change is like: ' Critical'->'Critical'              // leading space removed.


Better solution could be using Match()


Match(Priority,'Blocker','Critical','High','Medium','Low','Unassigned')