Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Color when an undefined value is there in a cell


Hi,

I have a pivot table where expression C = A/B; when B=0, it shows '-'. Its perfectly fine.

I want background color of the cell based on values of C..

if C<20%, red,

if 20%<=C<25%, Amber,

if C<=25%, Green,

if Undefined, Yellow,

I used the following expression -

=if(C<.2,red(),if(C>=.25,green(),if((C>=.2 and C<.25),rgb(255,183,255),yellow()))).

Two problems I am facing :-

1. Amber color is not proper, actually for that I want to use {rgb(255,183,255) hsl(200,240,206)}...but, am not able to use both ?

2. For undefined values, its not putting in Yellow..

Any idea ??

9 Replies
manideep78
Partner - Specialist
Partner - Specialist

Hi try this,

If(C<0.2,red(),if(C>=0.2 and C<0.25,RGB(255,191,0),if(C<=0.25, Green(),if(C='' or C=null(), Yellow()))))

If possible please attach the sample App

Regards,

Manideep

Not applicable
Author

The Yellow stuff is not working..actually, the value is not null rather it is undefined and tht's why, its not getting the condition for Yellow..

Not applicable
Author

Try like

if(C = '-',yellow())

--Singh

manideep78
Partner - Specialist
Partner - Specialist

Can you please give me the sample App

Not applicable
Author

Try putting Yellow on Else condition..

something like...
If(C<0.2,red(),if(C>=0.2 and C<0.25,RGB(255,191,0),if(C>0.25, Green(),Yellow()))))

or what  Angad Singh suggested.

Regards,
Dawar

manideep78
Partner - Specialist
Partner - Specialist

If(C<0.2,red(),if(C>=0.2 and C<0.25,RGB(255,191,0),if(C<=0.25, Green(),if(C='-' , Yellow()))))

OR


If(C<0.2,red(),if(C>=0.2 and C<0.25,RGB(255,191,0),if(C<=0.25, Green(),Yellow())))

qlikoqlik
Creator
Creator

HI

Please see below code I have used in the background of the expression

if((sum(ColorA)/sum(ColorB))<0.2,red(),
if((sum(ColorA)/sum(ColorB))>=0.2 and (sum(ColorA)/sum(ColorB))<0.25, rgb(255,183,255),
if((sum(ColorA)/sum(ColorB))>=0.25, Green(),
Yellow())))

Color.GIF.gif

Regards

Padma

Not applicable
Author

Can u try in case of Pivot ?..Yellow stuff is still not working for me ..:-(

qlikoqlik
Creator
Creator

Hi Vimal

It is working for me on Pivot table as well

if you can give me some sample data on excel I can try

Color.GIF.gif

Thanks

Padma