Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

atanthony
New Contributor II

Set color of pie chart based of one of three dimensions

I'm using an Expression to set the color of a Measure in a pie chart based on a dimension.  The dimension could be one of three options.  This will work for dimension option  - If(Dimension_A = "ABC, Blue()  -  For the three options I've tried

              If(Dimension_A = "AAA", Blue() Or  If(Dimension_A = "BBB, Red()  Or  If(Dimension_A = "CCC, Yellow().

This does not work.  Can you help me with the correct syntax?  Thank you.

1 Solution

Accepted Solutions
MVP
MVP

Re: Set color of pie chart based of one of three dimensions

not an or but an if ....else....else as Sunny already suggested

or a pick match

Pick(Match(Dimension_A, 'AAA', 'BBB', 'CCC'), Blue(), Red(), Yellow())

5 Replies
MVP
MVP

Re: Set color of pie chart based of one of three dimensions

Try with single quotes:

If(Dimension_A = 'AAA', Blue(),

If(Dimension_A = 'BBB', Red(),

If(Dimension_A = 'CCC', Yellow())))

MVP
MVP

Re: Set color of pie chart based of one of three dimensions

not an or but an if ....else....else as Sunny already suggested

or a pick match

Pick(Match(Dimension_A, 'AAA', 'BBB', 'CCC'), Blue(), Red(), Yellow())

atanthony
New Contributor II

Re: Set color of pie chart based of one of three dimensions

Thank you.  I received two answers, both worked.

atanthony
New Contributor II

Re: Set color of pie chart based of one of three dimensions

Thank you.  I received two answers, both worked.  I like Pick(Match....

MVP
MVP

Re: Set color of pie chart based of one of three dimensions

Great

You can always provide a helpful answer for something that helped

Qlik Community Tip: Marking Replies as Correct or Helpful

Best,

Sunny