1 Reply Latest reply: Feb 3, 2016 11:47 PM by Settu Periyasamy RSS

    Complicated aggr function

      I have a table with users money at the end of day.

      I have to calculate sum of users money at the end of each month.

       

      In this example I have to sum this lines for January (MonthsStart(date)):

      user1, 10.01.2016, 150

      user2, 20.01.2016, 200

      user3, 30.01.2016, 300

       

      For February:
      user1, 10.02.2016, 150    
      user2, 20.01.2016, 200

      user3, 30.02.2016, 300

       

       

      TestData:

      LOAD * INLINE [user, date, value

          user1, 01.01.2016, 75

          user1, 10.01.2016, 150

          user1, 01.02.2016, 75

          user1, 10.02.2016, 150   

          user2, 02.01.2016, 100

          user2, 20.01.2016, 200

          user2, 02.02.2016, 100

          user2, 20.02.2016, 200   

          user3, 03.01.2016, 100

          user3, 30.01.2016, 300

          user3, 03.02.2016, 100

          user3, 30.02.2016, 300   

      ];