Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

cbaqirdhds
Contributor 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

Re: Bar Chart Expressions Order

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

10 Replies
stigchel
Honored Contributor

Re: Bar Chart Expressions Order

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',.....)

cbaqirdhds
Contributor II

Re: Bar Chart Expressions Order

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
Honored Contributor

Re: Bar Chart Expressions Order

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')

cbaqirdhds
Contributor II

Re: Bar Chart Expressions Order

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
Honored Contributor

Re: Bar Chart Expressions Order

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

Re: Bar Chart Expressions Order

Can you post sample?

cbaqirdhds
Contributor II

Re: Bar Chart Expressions Order

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

Re: Bar Chart Expressions Order

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

cbaqirdhds
Contributor II

Re: Bar Chart Expressions Order

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

Community Browser