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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Conditional Backgroud Colors

Hi

In a table or pivot table I would like to set the background color dependent on a couple of conditions.

If area= West, then Apply colors if western goals are met/missed.

If area= East then  Apply colors if Eastern goals are met/missed

(East and West goals are different)

I can get one or the other to work but not both.

If I use the following the West  is color coded but the East has no  background colors.

Since it did not past well, I also put this in the note pad attachment

//if(
//[AREA]='West',

//       if ([% OT] <= .121, green(),

//if ([% OT] > .121 AND [% OT] < .25, rgb(255,255,102),
//if(
//[AREA]='East',
//if ([% OT] <= .1175, green(),
//if ([% OT] > .1175 AND [% OT] < .25, rgb(255,255,102), red() ))))))

     

//WEST GOAL COLOUR CODES

//if ([% OT] <= .121, green(),If ([% OT] >.121 and [% OT] <.25, rgb(255,255,102), red()))

//EAST GOAL COLOUR CODES

//if ([% OT] <= .1175, green(),If ([% OT] >.1175 and [% OT] <.25, rgb(255,255,102), red()))

2 Replies
ahaahaaha
Partner - Master
Partner - Master

Hi,

Your "common" algorithm looks like this

20170616_105603.jpg

You try to use the following code

if([AREA]='West',

if ([% OT] <= .121, green(),If ([% OT] >.121 and [% OT] <.25, rgb(255,255,102), red())),

if ([% OT] <= .1175, green(),If ([% OT] >.1175 and [% OT] <.25, rgb(255,255,102), red())))


Regards,

Andrey

Anonymous
Not applicable
Author

Thanks  Worked like a charm.