3 Replies Latest reply: Feb 19, 2016 4:22 AM by Yeo Poh sai

# How to make bar color > 36 %  Yellow    >33%  Green    >30% Org     < 27% Red  < 25% Black

Hi All

I am using QV , i insert below expression at sales expression blackground color , in order to make the bat reflect the GP% color :-

> 36 % Yellow >33% Green >30% Org < 27% Red < 25% Black

If(GP% > 0.36,Yellow(),

if(GP% > 0.3 and GP%<= 0.36,RGB(0,255,0),

if(GP% >0.27 and GP% <= 0.3,rgb(254,184,0),

if(GP% >0.25 and GP% <= 0.27,rgb(254,0,0),

If(GP% <= 0.25, rgb(0,0,0))))))

May i know where to insert the above script , so that it will have color on bar.

Paul

• ###### Re: How to make bar color > 36 %  Yellow    >33%  Green    >30% Org     < 27% Red  < 25% Black

Enclosed My QS Doc

• ###### Re: How to make bar color > 36 %  Yellow    >33%  Green    >30% Org     < 27% Red  < 25% Black

Hi Paul

Try this and see if it works :

in color and legend panel

select color by expression

if(

(sum(sales)-sum(cost))/sum(sales)<=0.36,RGB(0,255,0),

if(

(sum(sales)-sum(cost))/sum(sales)<=0.30,rgb(254,184,0),

if(

(sum(sales)-sum(cost))/sum(sales)<=0.27,rgb(254,0,0),

if(

(sum(sales)-sum(cost))/sum(sales)<=0.25,rgb(0,0,0),

yellow()))))

you may have this :

regards

• ###### Re: How to make bar color > 36 %  Yellow    >33%  Green    >30% Org     < 27% Red  < 25% Black

Hi Bruno

Thank you very much it work fine.

Paul