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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
christian77
Partner - Specialist
Partner - Specialist

Sorting Bar Chart Dimension by Double Criteria

Hi.

I want to sort my bar chart dimension by double criteria. We can see in the image that more than one criteria is admitted joining with ‘or’ & ‘and’.  The thing is that the help page does not say much about it and I do not know how to work it out to obtain what I want.

Anybody can show me how to use it to get those double sort criteria correctly. See the attached document.

Thank you.

Ordenacion.png

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Your expression will return true or false. So the values will be sorted by that. What you need is use something like this:

= 1000000*max({1} Order) - sum({1} Value). I've picked 1000000, so that sum(Value) stays below that. You could use something like sum({1} total Value) instead of 1000000 to make sure the multiplier for max(Order) is always larger than the sum.


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Your expression will return true or false. So the values will be sorted by that. What you need is use something like this:

= 1000000*max({1} Order) - sum({1} Value). I've picked 1000000, so that sum(Value) stays below that. You could use something like sum({1} total Value) instead of 1000000 to make sure the multiplier for max(Order) is always larger than the sum.


talk is cheap, supply exceeds demand
christian77
Partner - Specialist
Partner - Specialist
Author

Hi.

Thanks a lot Gylbert.

Your answer does not solve the double criteria syntax problem with logical operators.

Your answer logically adds those criteria and puts them together in single criteria.

Your answer works in the sample file correcting the constant, but I still didn’t make it work in the real one.

Let more people see the question before I…


christian77
Partner - Specialist
Partner - Specialist
Author

Hi.

The 2 pillars bridge.

A simple bridge wouldn’t make it. Instead of adding 2 fake dimension values in the script and then fill those 2 with variables, I use the total bar as one of the pillars.

The pillar on the left is a fixed value. The pillar on the right is the comparison column and it takes 4 different values depending on the buttons Budget, Last Year… In the middle, the difference between them dimensioned.

I finally made it.

Your answer was very good.

2PillarsBridge.png