13 Replies Latest reply: Jan 8, 2016 1:45 PM by Vladimir Komarov RSS

    Custom color by expression for two different expressions

    Allard Couwenberg

      I have a stacked bar-chart, with one dimension and two expressions.

      Both expressions have a different meaning, but should be stacked to indicate a total.

      By choosing color "Auto" or "Custom - Multicolored" I get the following visualization:

      20150617 - CustomColorByExpression.PNG

      Almost perfect... Just not these default colors blue and purple-red-ish.

      In the rest of my dashboard I use two custom colors for the meaning of these expressions, which I want to apply to this bar-chart.

       

      Choosing color "Custom - By expression" allows me to create an expression to color. But I cannot seem to make a color-expression that results in a different color for the first and second expression. The single color-expressions seems to be applied on both expressions equally and I don't know if (and how) I can actually make an "IF"-statement to address them separately...

      20150617 - CustomColorByExpression2.PNG

      One of the attempts include an IF statement that checks for a dimension-value particular for one of the expressions.

      Another attempt includes checking COLUMN(1), also didn't get that to work.

       

      How can I use the custom color expression to set different colors for expressions?