3 Replies Latest reply: Nov 1, 2016 5:21 AM by Clement Bitton RSS

    Line chart - colors by experssion and aggregation

    Clement Bitton

      Hi gurus,

       

       

      So I am trying to change the color of a line chart depending on the rank of an indicator in a different expression

       

      So I use the following expression :

       

      if(

        aggr(num(rank(aggr(count( {<  Group = {"hospitality"},statistic_id -= {"general_feeling"} , value ={">=3"}, status = {"approved"}> } [Feedbacks.%FEEDBACK]),statistic_id),4,1)),statistic_id)=Num(1), rgb(50,203,255),

        if(

        aggr(num(rank(aggr(count( {<  Group = {"hospitality"},statistic_id -= {"general_feeling"} , value ={">=3"}, status = {"approved"}> } [Feedbacks.%FEEDBACK]),statistic_id),4,1)),statistic_id)=Num(2),rgb(0,176,240),

        if(

        aggr(num(rank(aggr(count( {<  Group = {"hospitality"},statistic_id -= {"general_feeling"} , value ={">=3"}, status = {"approved"}> } [Feedbacks.%FEEDBACK]),statistic_id),4,1)),statistic_id)=Num(3),rgb(51,102,153),blue())

        )

      )

       

      However the problem if  I use this expression in the line chart, plotting through time, for each date the rank is re-evaluated.

      I am trying to make it consistent through time.

       

      Any ideas ?

       

      (I couldn't find any related issue, but please let me know if this is a duplicate)

       

      Thanks in advance for your help.