Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
cbaqir
Specialist II
Specialist II

Bar Chart Expressions Order

I have a combo chart that uses grouped and stacked bars to compare Allocated vs Actual (Plus PTO) hours. I cannot seem to figure out how to get the Allocated (blue) bar before the Actual (orange and green) bars. I'm certain there must be a way. Help!

7-15-2015 9-14-34 AM.gif

Thanks in Advance!

Cassandra

1 Solution

Accepted Solutions
Nicole-Smith

It's because your flag is null for the values that aren't 1 and QV always sorts null values to the end.

To fix, change your dimension for Flag to:

alt(Flag,0)

And then sort your Flag dimension by Numeric Value:

Capture2.PNG

View solution in original post

10 Replies
stigchel
Partner - Master
Partner - Master

Not sure what your dimensions and your expressions are?? Also don't think you can have mixed stacked and grouped, probably both stacked, but only 1 value(color?) for the blue one by the expression?

For an expression, you can select and just promote the Allocated Effort expression

For a dimension something like

=Match(YourDimension,'Allocated Effort','Actual Effort',.....)

cbaqir
Specialist II
Specialist II
Author

Please see my screenshot. I am comparing Allocated (grouped) to Actual + PTO (stacked). This is accomplished by adding a flag as a dimension.

7-15-2015 9-44-09 AM.gif

Allocated is already first in my Expression list.

7-15-2015 9-34-51 AM.gif

stigchel
Partner - Master
Partner - Master

Then you can probably just sort on the Flag dimension, if the flag is a number you can sort on numeric value for that dimension, ascending or descending. When it's text use sort on expression with the expression I already mentioned, sometehing like

=Match(Flag,'Yes','No')

cbaqir
Specialist II
Specialist II
Author

Thanks for the response.

My other dimension is a date (month/year) and that is the sort order for the x-axis. I'm new to using Flags, so please forgive my ignorance, but how would this work?

7-15-2015 9-57-10 AM.gif

stigchel
Partner - Master
Partner - Master

That's ok Cassandra, select FLAG_PTO in the dimensions area, then depending on the contents of FLAG_PTO as explained in my previous post only select numeric value in the sort by section, or only select the expression and use the expression e.g. =Match(Flag,'Yes','No')

Let me know

Kushal_Chawda

Can you post sample?

cbaqir
Specialist II
Specialist II
Author

Sample attached - I want the Allocated bar on the left and Stacked Actuals on the right

Nicole-Smith

It's because your flag is null for the values that aren't 1 and QV always sorts null values to the end.

To fix, change your dimension for Flag to:

alt(Flag,0)

And then sort your Flag dimension by Numeric Value:

Capture2.PNG

cbaqir
Specialist II
Specialist II
Author

Thanks Nicole! I haven't seen the alt function before.