13 Replies Latest reply: May 19, 2017 8:37 AM by Stefan Wühl RSS

    wrong aggr behavior for last day in month

    Nicoals Martin

      Hi,

       

      I have a problem with the aggr function: it doesn't sum the values from the last day of each month.

       

      Here is the data set:

      DateValue
      3/1/20175
      3/1/20176
      10/1/20177
      10/1/20175
      10/1/20172
      17/1/20179
      24/1/20178
      31/1/20179
      31/1/20179
      7/2/20172
      21/2/20176
      28/2/201720

       

      Here is the expected output

      DateValue
      31/1/201718
      28/2/201720

       

       

      The following solution takes the right dates but sum all the month values:

      Dimension =aggr(Max(Date),YearMonth)

      Measure = sum({$<Date= {"=aggr(Max(Date),YearMonth)"}>} [Planned value (K€)])

      DateValue
      31/1/201760 (wrong)
      28/2/201728 (wrong)

       

      Any idea to have only the sum of the last day? (without valuelist if possible)

       

      Many thanks in advance,

       

      Nicolas