8 Replies Latest reply: Aug 2, 2017 1:34 AM by Sumit Srivastava RSS

    Stock Analysis

    shweta gupta

      Hi All,

       

      I am working on Stock Analysis.

      Where a stock is scanned on dealers in a month.
      Data looks like below

       

      Account_ID     Date                     Stockqty

      1                    23-07-2017               10

      2                    24-07-2017               12

      2                     25-07-2017               13

      2                      25-07-2017               2   

      1                    27-07-2017                 9

       

       

      Expected Result

      2                     25-07-2017               15  

      1                    27-07-2017                 9

      whenever I will check for stock it should provide me the stock scanned on the maximum date of each dealer.

                        

      Please suggest the way to get this

       

      For now what  I have done is  aggr(Max(Date),Account_ID) to get the maximum date corresponding to each dealer but it is not giving me the Required Quantity!