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: 
jim_chan
Specialist
Specialist

how to sort by expression for a calculated dimension?

Hi guys, 

I have created a sample qvw file for my scenario. my problem, i cant sort by expression a calculate dimension.

my calculated dimension is:

=if(Match(cat,'bread','flour','others'),'others',cat)

then i tried to SORT BY expression:

MATCH(cat,'meat','vege','others')

my expected result:

the sorting in the table should be meat, vege,others. i couldnt get this result.

Can you guys help me out?

 

Rgds

Jim

Labels (2)
1 Solution

Accepted Solutions
sergio0592
Specialist III
Specialist III

Hi,

You can create another calculated dimension with:

MATCH(if(Match(cat,'bread','flour','others'),'others',cat),'meat','vege','others')

 

Sort on this dimension (Numeric Value/Ascending) and hide this dim in presentation tab.

See the attached .qvw

 

View solution in original post

4 Replies
jim_chan
Specialist
Specialist
Author

sorry,the attachment!

sergio0592
Specialist III
Specialist III

Hi,

You can create another calculated dimension with:

MATCH(if(Match(cat,'bread','flour','others'),'others',cat),'meat','vege','others')

 

Sort on this dimension (Numeric Value/Ascending) and hide this dim in presentation tab.

See the attached .qvw

 

riceball
Contributor
Contributor

Try: Sort expression = MATCH('meat','vege','others'). Remove the "cat"

jim_chan
Specialist
Specialist
Author

thanks bro, is helpful!