5 Replies Latest reply: Feb 16, 2016 3:28 AM by Betty Habtemariam RSS

    Problems with custom colouring a line chart

    Betty Habtemariam

      Hello everybody,

       

      I've been using a solution when custom colouring measures in a bar chart (see "How to set custom colors by measures in a bar chart") which was created by this guy called Ian Wilson. It's been working just fine. However, now I'm trying to do the same thing with a line chart, but it doesnät work. It's s if the expression seems too complex or something. Take a look.


      I have 2 dimensions; Month and Type. In the Type dimension I created a valueList to create temporary dimension and I wrote it like this: ValueList ('Result', 'Revenue PY', 'Budget').

      MEASURE! The measure I have is called Amount and the expression I wrote is:


      if(ValueList('Result','Revenue PY', 'Budget')='Result'

        ,Sum({1<%Restaurang=P(%Restaurang), [RR Grupp]={'Revenue PY'}, ÅrNum={'$(=Max(ÅrNum))'}, ÅrMånad={'<=$(=Max(ÅrMånad))'}>}Result)

       

        ,if(ValueList('Result','Revenue PY', 'Budget')='Revenue PY'

         ,Sum({1<%Restaurang=P(%Restaurang), [RR Grupp]={'Revenue PY'}, ÅrNum={'$(=Max(ÅrNum))'}, ÅrMånad={'<=$(=Max(ÅrMånad))'}>}Result)

       

         ,Sum({1<%Restaurang=P(%Restaurang), [RR Grupp]={'Revenue PY'}, ÅrNum={'$(=Max(ÅrNum))'}>}Budget)

           )

        )

       

       

      In the appearance section i went to the coloring section and wrote the following expression:

       

      if(ValueList('Result','Revenue PY','Budget')='Result'

        ,rgb(0,192,0)

        ,if(ValueList('Result','Revenue PY','Budget')='Revenue PY'

           ,rgb(0,0,192)

           ,rgb(192,0,0)

           )

        )

       

       

      The colors only appear when the measure expressions aren't that complex. If I would've written this instead it works:

       

      if(ValueList('Result','Revenue PY', 'Budget')='Result'

        ,Sum(Result)

       

        ,if(ValueList('Result','Revenue PY', 'Budget')='Revenue PY'

         ,Sum(Result)

       

         ,Sum(Budget)

           )

        )

       

      Can someone help me understand how to make Ian Wilsons trick work on this? How can I make it work with my expression?

       

      Sincerely,

      Betty