Skip to main content
Announcements
Qlik Community Office Hours - Bring your Ideation questions- May 15th, 11 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Multicolor Percentage Charts

Greetings again!

Have stepped on something aparently simple, but so far, unsolvable by my skills...

I must create bar/gauge charts, segmenting it by three colors, by the simples rules...

In Percentage:

<= 10% - GREEN

>10 and <= 15% - YELLOW

> 15% - RED

I tried using this nested IF statement:

IF((sum(if(Aging > 15, [USD])) / sum([USD])) <= 10/100, RGB(100,255,0),

IF((sum(if(Aging > 15, [USD])) / sum([USD])) >10/100,RGB(255,255,0),

IF((sum(if(Aging > 15, [USD])) / sum([USD])) <= 15/100,RGB(255,255,0),

IF((sum(if(Aging > 15, [USD])) / sum([USD])) > 15/100,RGB(255,10,10)))))

in the COLORS chart properties, but have not worked... (all turns YELLOW).

Tried using it in the expression itself, and have not worked either...

The result was:

chart1.JPG

And the Gauge Chart:

chart2.JPG

The colors being chosen as segments, not respecting the IF calculations, and with no data on the scale, but the 0%.

Have anyone stepped on something like that?

Thank you all in advance.

1 Solution

Accepted Solutions
erichshiino
Partner - Master
Partner - Master

at the chart properties, expressions tab, click on the "+" symbol on the side of your expression. The formula you created goes in the background color there.

View solution in original post

4 Replies
erichshiino
Partner - Master
Partner - Master

Your expression has actually only two conditions

<= 10% and >10%

IF((sum(if(Aging > 15, [USD])) / sum([USD])) <= 10/100, RGB(100,255,0),

IF((sum(if(Aging > 15, [USD])) / sum([USD])) >10/100,RGB(255,255,0) -> at this point you have covered the two possibilities.

Try this:

IF((sum(if(Aging > 15, [USD])) / sum([USD])) <= 0.10,lightgreen(),

IF((sum(if(Aging > 15, [USD])) / sum([USD])) <= 0.15, yellow(), lightred() ))

And you need to put this expression on the background color of your expression

Hope it helps,

Erich

Not applicable
Author

Erich, thank you so much for answering!!!

The expression works, but also makes everything turns to yellow when I use it to calculate the colors...

When you say "put this expression on the background color of your expression", where must I put it?

Thank you again!!!

erichshiino
Partner - Master
Partner - Master

at the chart properties, expressions tab, click on the "+" symbol on the side of your expression. The formula you created goes in the background color there.

Not applicable
Author

NAILED IT!!! Thank you very much!!!