3 Replies Latest reply: Jul 1, 2013 10:45 AM by Marcelo Gittermann RSS

    Set Analysis max date

      Good day

      There is a need to calculate the stock at the end of the month

       

      Table_stock:

       

      GoodsDate
      Stock_qty
      103.11.122
      110.11.124
      120.11.122
      102.12.1254
      106.12.123

       

      Calendar table:

      DateMonthWeek
      01.11.12November34
      .........
      06.12.12December40

       

       

       

      Pivot Table

       

      GoodsMonthStock qty
      1november2
      1December3

       

       

      I tried a set analysis and if

       

      Sum({<Date={'$(=Max(Date))'}>} Stock)

      Aggr(Sum({<Date={'$(=Max(Date))'}>} Stock),Goods,Month)

      Sum({<Date={'$(=Aggr(Max(Date),Month))'}>} Stock)

      Sum(if(Date=Max(Total Date),Stock))