2 Replies Latest reply: Nov 5, 2017 11:01 AM by Jordan Hertl

# Help with Conditionally coloring percentages

Hi all, I was wondering if anyone could help me with this formula.

My first formula works...here it is.

Num(Count({<test_score = {">=4"}>} test_score) /Count(test_score),'0%')

This is giving me a KPI with a percentage of how many test scores are over 4.

I wanted to conditionally color it based on how high the percentage is. This is the part I am having a difficult time with.

=if(([test_score]) >= 60, rgb(132,186,8))

=if(([test_score]) >=31 and <-59 rgb(255,203,85))

=if(([test_score]) <= 30, rgb(247,77,49))

Can anyone help me to get this to work? I think the first and 3rd lines work but I am not sure how to get this range between 31 and 59 to work.

Thanks,

Jordan

• ###### Re: Help with Conditionally coloring percentages

It's way simpler than that

use a KPI object;

as an expression :

Count({<test_score = {">=4"}>} test_score) /Count(test_score)

don't use the num to format it; you can format it using qlik sense options:

NOW? YOUR MEASURE WOULD BE FROM 0 TO 1

to color it:

under color, activate conditionnal colors; add 2 new limiters 0.3 and 0.6; and then qlik on the bar to choose ur colors:

• ###### Re: Help with Conditionally coloring percentages

Thanks Omar. That appears to have worked.