6 Replies Latest reply: May 9, 2017 10:06 PM by Kenny tang RSS

    Find latest status and sum value

    Kenny tang

      Hi All,

       

       

      I have a table below, what i want is to get the updated status of of users and sum all those values and do it in function , any suggestion ?

       

       

       

      UserID    Date         Status           Value

      A         13/2/2017     Status_A         100

      A         13/3/2017     Status_A         100

      A         13/6/2017     Status_B         200

      A         13/7/2017      Status_B         300

      A         13/12/2017    Status_B         400                 (So sum all Status_B for A)

      B         13/1/2017     Status_C          1

      B         13/2/2017     Status_C          2

      B         13/12/2017    Status_D         4                   

       

      The expected result

       

      UserID      Status        Sum

      A         Status_B      900    (200+300+400)  

      B         Status_D      4  

       

      Thanks in advance