2 Replies Latest reply: Oct 26, 2009 6:48 PM by AllenMcq RSS

    Color in Pivot cell

    saepinfo

      Hi

      I want to change color cell in a Pivot.

      For value from 0 to 1.000.000 gradient white to green

      For value > 1.000.000 green

      I insert to following expression in color background normal calculate in Table properties (Visual properties)

      ColorMix1 ( if ($(FatturatoAlGiornoCorrente) > 1000000, 1 , ($(FatturatoAlGiornoCorrente) / 1000000), white (), green ())

      where variable FatturatoAlGiornoCorrente is the value in the column.

      The result is always white color.

      Thanks.

      Antonio Benvenuti

        • Color in Pivot cell

          Try using an If else to determine rgb(),

          =If(value >= 1.000.000, rgb(0,255,0), rgb(0, 255 * (value/1.000.000), 0)

          'value' could be a formula or if you use a variable in your loading script remember to use $([name of variatble])

            • Color in Pivot cell

              I'm sorry I don't know what I was thinking.

               



              =If(sum(Value) >= 1000000,
              rgb(0,255,0),
              rgb(255-ROUND(255 *(sum(Value)/1000000)),
              255 ,
              255-ROUND(255 *(sum(Value)/1000000))))




              I added the ROUND function incase Qlikview doesn't convert a decimal to an integer.

              This should move it from Bright Green to White

              Problem though when inserting this code into the Pivot chart. It will not group the SUM(Value) by the dimension.

              So I'm not sure if this will do it for you.