6 Replies Latest reply: Dec 13, 2012 6:00 AM by Gutemberg Fayad RSS

    How to change graph colors based on calculated dimension values

    Gutemberg Fayad

      I have a dimension that

       

      aggr

       

      (sum (Qtde) /
      (
      sum ({$<Ano_Mes = {$(=Max(Ano)&num(Max(Mes),'00') ) } >}  [Expectativa Vendas])
      *
      num(MaxString([Mês Filtro]))), PartNumber)

       

       

      And  depends on the results I need   diferent collors in the pizza graphs.

       

       

        • Re: How to change graph colors based on calculated dimension values
          mayilvahanan ramasamy

          HI

           

          Can you explain more details? If possible, can you provide a sample file?

            • Re: How to change graph colors based on calculated dimension values
              Gutemberg Fayad

              Sorry, unfortunately i have sensitive data and i cannot create a sample, however below i put more details

               

              Dimension :

              = if(

              aggr(sum (Qtde) /
              (
                  sum ({$<Ano_Mes = {$(=Max(Ano)&num(Max(Mes),'00') )} >}

              [Expectativa Vendas])
                     *  num(MaxString([Mês Filtro]))), PartNumber)

              <=Var_Cor_Penetracao_Amarelo,
                    
              dual('Crítico',1)  ,

                 if(
                
                 aggr(sum (Qtde) /
              (
                  sum ({$<Ano_Mes = {$(=Max(Ano)&num(Max(Mes),'00') )} >}

              [Expectativa Vendas])
                     *  num(MaxString([Mês Filtro]))), PartNumber)

              <=Var_Cor_Penetracao_Laranja ,
                   
              dual('Regular',2),

              if(
              aggr(sum (Qtde) /
              (
                  sum ({$<Ano_Mes = {$(=Max(Ano)&num(Max(Mes),'00') )} >}

              [Expectativa Vendas])
                     *  num(MaxString([Mês Filtro]))), PartNumber)

              <=Var_Cor_Penetracao_Marinho,
                    
              dual('Bom',3),
              if(
              aggr(sum (Qtde) /
              (
                  sum ({$<Ano_Mes = {$(=Max(Ano)&num(Max(Mes),'00') )} >}

              [Expectativa Vendas])
                     *  num(MaxString([Mês Filtro]))), PartNumber)

              <=Var_Cor_Penetracao_Verde,
                    
              dual('Muito Bom',4),

                if(aggr(sum (Qtde) /
              (
                  sum ({$<Ano_Mes = {$(=Max(Ano)&num(Max(Mes),'00') )} >}

              [Expectativa Vendas])
                     *  num(MaxString([Mês Filtro]))), PartNumber)

              >Var_Cor_Penetracao_Verde,
                    
              dual('Excelente',5)
               
              )
              )
              )
              )
              )

               

              Expression : Count (DISTINCT PartNumber)

               

              I've already tried put the same expession ,  only chaging dual function by the collor (red(), blue etc),  in the background color propertie from this dimension and also in the background collor from the expression.

            • Re: How to change graph colors based on calculated dimension values
              Gysbert Wassenaar

              Click on the + in front of the dimension and select Background Color. Then click on the Edit button. Now you can add an expression that calculates the color.

               

              If( some_epxr = 12, red(), if some_epxr = 18.5, green(), blue() ))

               

              Replace some_expr with your expression for the calculated dimension and change the comparison values as needed.

              If you have a lot of values, you might want to use a pick-match combination instead of a nested if.