New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

New Contributor

Combo chart - Changing colour of bars

Hi Community,

I have a simple combo chart that compares Actual, Forecast and PY data for 3 channels (Factory, Bought In & Bedding).

I want my Actual Factory, Actual Bought In and Actual Bedding to be one colour.

I then want Forecast Factory, Forecast Bought In & Forecast Bedding to be a different colour.

I then want PY Factory, PY Bought In & PY Bedding to be a different colour.

Please can you help - I have attached my chart to demonstrate my point.

4 Replies
Contributor III

Re: Combo chart - Changing colour of bars

define your measures as master items, and choose color in the master item definition :-)

Contributor III

Re: Combo chart - Changing colour of bars

Hi Vasim,

You need to color your chart by expression with your Dimension value, here the example:

If(WildMatch(Dimension,'Actual*'), Red(),

If(WildMatch(Dimension,'Forecast*'), Green(),  Blue()))

Best,

Quy

New Contributor

Re: Combo chart - Changing colour of bars

Hi Quy

Thanks so much for replying. Can I ask one more questions if I may...

I type in the following formula:

If(WildMatch(Sales,'Actual*'),Blue(),If(WildMatch(Sales,'Forecast*'),Red(),If(WildMatch(Sales,'PY*'),Green())))

and the graph becomes completely grey in colour i.e. all the bars

If I type in the formula you suggested:

If(WildMatch(Sales,'Actual*'),Blue(),If(WildMatch(Sales,'Forecast*'),Red(),Green()))

the graph becomes completely green in colour i.e. all the bars

Do you know why? The formula expression is correct as QS accepts it, but the colours on the individual bars don't change.

On a separate note, the GP% (horizontal lines above each bar) also change colour when I don't want them to...

Many thanks again.

Vasim

Contributor III

Re: Combo chart - Changing colour of bars

What is your dimension in the chart? Please use it it the expression.

The second expression return green color because it's the default color based on If condition logic when dimension not match Actual* or Forecast*