9 Replies Latest reply: Oct 5, 2016 2:59 PM by Rob Wunderlich RSS

    Persistent colour not working with calculated dimension

    Patrik Lindegårdh

      Hi,

       

      I have an application where we have 2 similar but different calculated dimensions with 3 different fields in those dimensions. There are 3 colors assigned and in settings we have persistent colors. The problem occurs when you make a selection in on the charts then suddenly the colors jump around even though the text stays in the same order. I have tried to use background color with the same expressions but it doesn't work. I suspect it has to do with sort order where I have selected numeric value which works perfect for the text in the dimension but not for the colors. In the screenshots you see how the color jump around but not the text which stays consistent.

      picture1.PNGpicture2.PNG

       

      first calculated dimension:

      =

      if(

        aggr((max([field1]) + max([field2)), field3) = 0

        OR aggr(max([field4)/(max([field1]) + max([field2])), field3) >= 100,

        dual('text1)', 1),

         if(aggr(max([field4])/(max(field1]) + max([field2])), field3) < 100,

        dual('text2', 2),

        dual('text3', 3)

        )

      )

       

      background colour:

      if(

        aggr((max([field1]) + max([field2)), field3) = 0

        OR aggr(max([field4)/(max([field1]) + max([field2])), field3) >= 100,

        RGB(0,128,64),

         if(aggr(max([field4])/(max(field1]) + max([field2])), field3) < 100,

        RGB(192,192,192),

        RGB(255,217,47)

        )

      )

       

      Expression:

      count(DISTINCT field3) / count(DISTINCT TOTAL field3)

       

      The other calculated dimension is similar:

      =

      if(

        aggr(max([field5]), field3) = 0

        OR aggr(max([field4])/max([field5]), field3) >= 100,

        dual('text4)', 1) ,

        if(aggr(max([field4])/max([field5]), field3) < 100,

      dual('text5', 2),

        dual('text6', 3)

        )

      )

      Background colour2:

      =

      if(

        aggr(max([field5]), field3) = 0

        OR aggr(max([field4])/max([field5]), field3) >= 100,

        RGB(0,128,64),

        if(aggr(max([field4])/max([field5]), field3) < 100,

        RGB(192,192,192),

        RGB(255,217,47)

        )

      )

       

      Expression3:

      count(DISTINCT field3) / count(DISTINCT TOTAL field3)