Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
atanthony
Contributor II
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
maxgro
MVP
MVP

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

View solution in original post

5 Replies
sunny_talwar

Try with single quotes:

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

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

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

maxgro
MVP
MVP

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
Contributor II
Contributor II
Author

Thank you.  I received two answers, both worked.

atanthony
Contributor II
Contributor II
Author

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

sunny_talwar

Great

You can always provide a helpful answer for something that helped

Qlik Community Tip: Marking Replies as Correct or Helpful

Best,

Sunny