Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Kirsten
Creator II
Creator II

Sort by expression

Hi,

I currently would like to sort by expression to create a custom order of my barchart. Currently it is sorting by number: Field Replacements, Diagnostics, DEFOA, Factory Defects. But the order should change to: Factory Defects, DEFOA, Field Replacements, Diagnostics. (See Image).  I did read on the forum that this can be done by sort by expression: Match([PPG], 'Factory Defects', 'DEFOA', 'Field Replacements' and 'Diagnostics') which I added to in the expression editor, and did select apply. However after adding this, there is no change in my graph. (See image to see how it is applied in sort). What do I miss?

Labels (2)
2 Solutions

Accepted Solutions
JordyWegman
Partner - Master
Partner - Master

Hi Kirsten,

Try this:

Match([PPG], Dual('Factory Defects',1), Dual('DEFOA',2), Dual('Field Replacements',3), Dual('Diagnostics',4))

These duals will give an value to the names.

Jordy

Climber

Work smarter, not harder

View solution in original post

lorenzoconforti
Specialist II
Specialist II

In the sorting section of your chart object, move the PPG section on top

View solution in original post

7 Replies
lironbaram
Partner - Master III
Partner - Master III

hi 

you didn't add any images 

can you add them 

 

Kirsten
Creator II
Creator II
Author

Sorry 🙂 Can you see it now?

JordyWegman
Partner - Master
Partner - Master

Hi Kirsten,

Try this:

Match([PPG], Dual('Factory Defects',1), Dual('DEFOA',2), Dual('Field Replacements',3), Dual('Diagnostics',4))

These duals will give an value to the names.

Jordy

Climber

Work smarter, not harder
Kirsten
Creator II
Creator II
Author

Hi Jordy,

Thanks for the message. I have added the new expression, but it still does not have an effect on my graph. When adding the expression I click fX under sorting/sort by expression, then add the expression and click Apply. Sort by Expression is selected, sort numerically and sort alphabetically is unselected 

Am I missing a step to activate the expression in the graph? See Image

Regards, Kirsten

lorenzoconforti
Specialist II
Specialist II

In the sorting section of your chart object, move the PPG section on top

Kirsten
Creator II
Creator II
Author

Now it works. Thanks 🙂

jcampbell
Partner - Creator
Partner - Creator

Thanks for this. Very helpful!