Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

color in table based on variable

how can you color   have multiple colors when using the Background color expression?

Below is what I am trying with no luck.

if(ActPkgCost/PurchPackSz<0.25, green(),

 

              if(ActPkgCost/PurchPackSz>0.25, <0.50 Yellow(),

 

              if(ActPkgCost/PurchPackSz>0.50, Red())))

 

1 Solution

Accepted Solutions

Re: color in table based on variable

Try this

If(ActPkgCost/PurchPackSz < 0.25, Green(),

     If(ActPkgCost/PurchPackSz < 0.50, Yellow(),

          If(ActPkgCost/PurchPackSz > 0.50, Red())))

5 Replies

Re: color in table based on variable

Try this

If(ActPkgCost/PurchPackSz < 0.25, Green(),

     If(ActPkgCost/PurchPackSz < 0.50, Yellow(),

          If(ActPkgCost/PurchPackSz > 0.50, Red())))

mjtaft2017
Contributor

Re: color in table based on variable

Hi Sunny -

Is yours (above) missing a comma just before Yellow()  - I included the comma below 

If(ActPkgCost/PurchPackSz < 0.25, Green(),

     If(ActPkgCost/PurchPackSz < 0.50, Yellow(),

          If(ActPkgCost/PurchPackSz > 0.50, Red())))

color in table based on variable

Re: color in table based on variable

I did

mov
Esteemed Contributor III

Re: color in table based on variable

OK, if we're speaking of improvements...

If(ActPkgCost/PurchPackSz < 0.25, Green(),

     If(ActPkgCost/PurchPackSz < 0.50, Yellow(),

          Red()))

mjtaft2017
Contributor

Re: color in table based on variable

try Sunny's or try this with your original

if(ActPkgCost/PurchPackSz<0.25, green(),

              if(ActPkgCost/PurchPackSz >= 0.25 and ActPkgCost/PurchPackSz < 0.50, Yellow(),

              if(ActPkgCost/PurchPackSz >= 0.50, Red())))

Community Browser