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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Mkh13646
Contributor
Contributor

How sort bar chart based on specific order

Hello everyone, 

I have a  stacked bar chart  with some departments as a dimension and calculated measures as the length of the bar,

 

dsh.png

 

I used the sort by expression and write below expression but it doesn't work 

Match(Departement,'[Exec. Office]','Admin','Financial','Drilling','Geophysics' , 'Drill Bits','E&P' )

I would be grateful if someone can help me

Labels (2)
12 Replies
Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

Under Sorting tab, have you tried to disable Auto and all other checked under Sorting tab for the rest of the fields ? That might be the reason why your sorting with expression is not working

 

Mkh13646
Contributor
Contributor
Author

yes @Gabriel , I  uncheck them all  except sort by  expression

Gabriel
Partner - Specialist III
Partner - Specialist III

Spoiler
 

Hi,

Please upload .qvf 

buchberger_a
Contributor III
Contributor III

Could it be, that you have a typo in your code

in the grafics it shows Exce. office, but you are searching for [Exec.office]?

Kushal_Chawda
MVP
MVP

It could be due to other selections affecting the sort order expression. try excluding all selection

Match(only({1}Departement),'Exec. Office','Admin','Financial','Drilling','Geophysics' , 'Drill Bits','E&P' )

Mkh13646
Contributor
Contributor
Author

@Gabriel sorry, I don't have access to .qvf file because of  data privacy

Mkh13646
Contributor
Contributor
Author

@Kushal_Chawda I also try this solution, but it doesn't work!

Mkh13646
Contributor
Contributor
Author

@buchberger_a  I don't think so, I double-checked everything 

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

 

Try to remove [] from Exec. Office

Match(Departement,'Exec. Office','Admin','Financial','Drilling','Geophysics' , 'Drill Bits','E&P' )