6 Replies Latest reply: Nov 17, 2015 8:37 AM by Gerd Neumann

Set Color of Background Based on Value

QV Community,

I am hoping that someone could help me with a question about setting colors in charts/tables based on a value. Specificlly, I have a straight table and want to set the color of the backgroup for the expression based on the calculated value. I know I can use some "IF"statements to do this but to be honest I am tired of having to do this for each place where I am calculating this particular value.

1) Can you refer to an aggragation by using the name of the label?

IF(sum(value1)/sum(2) >= 1 and sum(value1)/sum(2) <= 10,rgb(255,0,0),

if(sum(value1)/sum(2) >= 11 and sum(value1)/sum(2) <= 20, rgb(1,1,1) , rgb(1,2,3)))

OR could I....

IF([LABEL]>= 1 and []LABEL <= 10,rgb(255,0,0),

if([LABEL] >= 11 and [LABEL] <= 20, rgb(1,1,1) , rgb(1,2,3)))

I have a hand full of statistics that I have to do this for so if there anything out there in the form of a template or reference that can provide an easier way to do this?

Thank you,

• Re: Set Color of Background Based on Value

You can assign your complex expresion to some variable. For example exValueColor.

And than use \$(exValueColor) instead of all that complex expression.

where the value of exValueColor is  an expression without leading '='.

Its very useful method to store color expressions (like rgb(1,1,1)). Otherwise its realy hard to change colors if you have dozens of expressions.

From one side you have the same simple expression everywhere, from the other - you will soon forget what expression was stored in the variable.

• Re: Set Color of Background Based on Value

Pass me the file.

• Re: Set Color of Background Based on Value

Hi,

Can you provide the data in excel file, please.

• Re: Set Color of Background Based on Value

Hi Villegas,

Regards,

Arun.

• Re: Set Color of Background Based on Value

Exactly what I was looking for thank you!

• Re: Set Color of Background Based on Value

Can anyone post te expression please i'm searching the same thing, i can't open the file.

Regards,

Gerd Neumann