14 Replies Latest reply: Jun 15, 2017 9:57 AM by Mark Ritter RSS

    color expression for two measures

    Monica Labrador

      Hi,

       

      I have a stacked bar chart with two measures that give me the number of open and closed tickets in a given month:

      Screen Shot 2017-06-12 at 2.49.19 PM.png

       

      The expression for "closed" is:

      Sum(
        aggr(
        if(month_opened<=_month  and (_month<=month_closed or isnull(month_closed) ), 1, 0),
              _month,
              id
          )
      )
      -
      Sum(
        aggr(
        if(month_opened<=_month  and (isnull(month_closed) ), 1, 0),
              _month,
              id
          )
      )

       

      And the expression for "open" is:

      Sum(
        aggr(
        if(month_opened<=_month  and (isnull(month_closed) ), 1, 0),
              _month,
              id
          )
      )

       

       

      I need to change the color of the open and closed stacked bars, but have not had luck with an if-statement, I think it's because of the use of the aggr function. Any help is much appreciated.