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

    Set Color of Background Based on Value

    Ismael Villegas II

      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,