4 Replies Latest reply: Nov 30, 2017 5:17 AM by Philippe Motillon RSS

    Coloring a pie chart using expression

    Philippe Motillon

      Hi all ,

      I am trying to color a pie chart using the following expression :

       

      =if (aggr(SUM({<CUSTOMER_ID={"=sum(PHASEDCALLS) > count(DISTINCT EVENT_ID)"},FileType=>} PHASEDCALLS)-

      count({<RecordType={'CALL'},FileType=,CUSTOMER_ID=p({<CUSTOMER_ID={"=sum(PHASEDCALLS) > count(DISTINCT EVENT_ID)"}>}CUSTOMER_ID)>} Distinct EVENT_ID),CUSTOMER_ID) = 1,

      Yellow(),

      if (aggr(SUM({<CUSTOMER_ID={"=sum(PHASEDCALLS) > count(DISTINCT EVENT_ID)"},FileType=>} PHASEDCALLS)-

      count({<RecordType={'CALL'},FileType=,CUSTOMER_ID=p({<CUSTOMER_ID={"=sum(PHASEDCALLS) > count(DISTINCT EVENT_ID)"}>}CUSTOMER_ID)>} Distinct EVENT_ID),CUSTOMER_ID) = 2,

      lightblue(),

      if (aggr(SUM({<CUSTOMER_ID={"=sum(PHASEDCALLS) > count(DISTINCT EVENT_ID)"},FileType=>} PHASEDCALLS)-

      count({<RecordType={'CALL'},FileType=,CUSTOMER_ID=p({<CUSTOMER_ID={"=sum(PHASEDCALLS) > count(DISTINCT EVENT_ID)"}>}CUSTOMER_ID)>} Distinct EVENT_ID),CUSTOMER_ID) = 3,

      lightred(),

      if (aggr(SUM({<CUSTOMER_ID={"=sum(PHASEDCALLS) > count(DISTINCT EVENT_ID)"},FileType=>} PHASEDCALLS)-

      count({<RecordType={'CALL'},FileType=,CUSTOMER_ID=p({<CUSTOMER_ID={"=sum(PHASEDCALLS) > count(DISTINCT EVENT_ID)"}>}CUSTOMER_ID)>} Distinct EVENT_ID),CUSTOMER_ID) > 3,

      lightred(),

      green()))))

       

      It works when the expression = 1 , 2, 3 , but it does not work when the expression is > 3.

       

      Any ideas ?

       

      thanks a lot

       

      Philippe

        • Re: Coloring a pie chart using expression
          Luc Lacroix

          Hi Philippe,

           

          There is two lightred one for = 3 the other for > 3 try changing the second for an other color

           

          =if (aggr(SUM({<CUSTOMER_ID={"=sum(PHASEDCALLS) > count(DISTINCT EVENT_ID)"},FileType=>} PHASEDCALLS)-

          count({<RecordType={'CALL'},FileType=,CUSTOMER_ID=p({<CUSTOMER_ID={"=sum(PHASEDCALLS) > count(DISTINCT EVENT_ID)"}>}CUSTOMER_ID)>} Distinct EVENT_ID),CUSTOMER_ID) = 1,

          Yellow(),

          if (aggr(SUM({<CUSTOMER_ID={"=sum(PHASEDCALLS) > count(DISTINCT EVENT_ID)"},FileType=>} PHASEDCALLS)-

          count({<RecordType={'CALL'},FileType=,CUSTOMER_ID=p({<CUSTOMER_ID={"=sum(PHASEDCALLS) > count(DISTINCT EVENT_ID)"}>}CUSTOMER_ID)>} Distinct EVENT_ID),CUSTOMER_ID) = 2,

          lightblue(),

          if (aggr(SUM({<CUSTOMER_ID={"=sum(PHASEDCALLS) > count(DISTINCT EVENT_ID)"},FileType=>} PHASEDCALLS)-

          count({<RecordType={'CALL'},FileType=,CUSTOMER_ID=p({<CUSTOMER_ID={"=sum(PHASEDCALLS) > count(DISTINCT EVENT_ID)"}>}CUSTOMER_ID)>} Distinct EVENT_ID),CUSTOMER_ID) = 3,

          lightred(),

          if (aggr(SUM({<CUSTOMER_ID={"=sum(PHASEDCALLS) > count(DISTINCT EVENT_ID)"},FileType=>} PHASEDCALLS)-

          count({<RecordType={'CALL'},FileType=,CUSTOMER_ID=p({<CUSTOMER_ID={"=sum(PHASEDCALLS) > count(DISTINCT EVENT_ID)"}>}CUSTOMER_ID)>} Distinct EVENT_ID),CUSTOMER_ID) > 3,

          lightred(),

          green()))))

           

          Regards.

          Luc

          • Re: Coloring a pie chart using expression
            Philippe Motillon

            Unfortunatly the app is really big (more than 600mb).

            I will try to create a small App.

             

            Thanks for your help

             

            Philippe