Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
dandaanilreddy
Partner - Creator III
Partner - Creator III

Background Color for values based on percentage

Hello 

I want to color the cells based on the value range in straight table. if the values percentage range greater than 75% i want to show it in red, if the range is from 75%  to 25% i want to color as yellow and if its below 25% i want to color as green. 

SectorValue 
Pharma0.41
Pharma0.53
Pharma0.18
Pharma0.46
Pharma0.73
Pharma0.93

 

From the above:

0.41,0.53,0.46 should be yellow

0.18 should be green

0.73, 0.93 should be red.

Please can someone let me know how can i achieve this?

Thanks

4 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi 

use the background color expression property and use the expression as below

If(Value>0.75, Red(),
If(Value>=0.25, Yellow(),Green()))

CELAMBARASAN_0-1631542834939.png 

CELAMBARASAN_2-1631542915263.png

 

 

dandaanilreddy
Partner - Creator III
Partner - Creator III
Author

Hi

Thanks for the response. I don't want to hardcode the no's . In the above example the max percentage starts with 0.93 which i need to consider as 100 % and color the values which comes under <=75% as red.

 

Thanks

stevejoyce
Specialist II
Specialist II

you can look into the colormix1 and colormix2 function.  Qlikview had a "wizard" to jump start on it and you can alter as needed.

If you are looking to do a base your colors on rank, you can add on to what @CELAMBARASAN said like  

If(rank(<expression>)=1, green(),

If(rank(<expression>)<=5, yellow,

red()))

CELAMBARASAN
Partner - Champion
Partner - Champion

May be try the below one

If((Value/Max(total<Sector>Value))>0.75, Red(),
If((Value/Max(total<Sector>Value))>=0.25, Yellow(),Green()))