Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm having this "issue" with color consistency in bar charts whenever a drill-down dimension is used. See the example in attachment.
The bar charts in the example have a group as dimension (no issues there) and two expressions that should output color-consistent results, meaning that Plan-values should always be color1 and Actuals should be color2. This works nicely in bar charts where you enable "Persistent colors" and in which either Cyclic groups or plain fields are used as dimensions. See the top chart.
However, as soon as you insert a Drill-down group as dimension, odd things start happening. Two quick cases:
It has something to do with missing data for the first expression causing the second expression to misbehave. But only in a chart with a drill down group. The chart at the top (Cyclic gorup) is consistently correct.
Any logic that I'm unfamiliar with? Thanks.
Peter
You may also modify your expression to avoid nulls:
if(IsNull(Sum(RevPlan)/Sum(VolPlan)),0,Sum(RevPlan)/Sum(VolPlan))
You may do this also adding new expression hidden (by unchecking Bar) or (if you know that your values are >0, you may use:
rangemax(Sum(RevPlan)/Sum(VolPlan),0)
regards
D
I guess this must be a bug or something?
This has nothing to do with the Dimension used, the difference is that in the top chart you will get 0 for the "missing" expression, whereas in the lower you will get NULL.
The setting "Persistent colors" i think only relates to colors associated with field values, and not for when colors are determined by expressions.
If you want your colors to be persistent on expressions you can set the color using the "Background Color" sub-expression.
You may also modify your expression to avoid nulls:
if(IsNull(Sum(RevPlan)/Sum(VolPlan)),0,Sum(RevPlan)/Sum(VolPlan))
You may do this also adding new expression hidden (by unchecking Bar) or (if you know that your values are >0, you may use:
rangemax(Sum(RevPlan)/Sum(VolPlan),0)
regards
D
Ok; thanks. Now I know why it doesn't work as expected.
I'm still wondering why it works like it does however... Using the Totals-color instead is pretty random, no? In addition to that, if it's true that the Persistent colors checkmark applies only to dimension values, then why are single dimension/double expression charts using different colors at all? Some QV code is already taking care of this situation, so why doesn't it apply the Persistent Colors setting as well when there is only one dimension?
Best solution would be to disable the checkmark (grayed) whenever it doesn't apply or causes random results.
We already fixed it using IsNull(). Forgot to mention this, sorry.
Anyway, I don't like the Background color expression solution to work around this behavior because it forces developers to pile expression upon expression in every chart that deviates from the default layout. And UI objects quickly become difficult to manage/maintain/understand/document in any "advanced" document. Even with expressions-in-variables.
Looks like expression list is a kind of dimension.