4 Replies Latest reply on Oct 3, 2018 4:11 AM by Manish Chauhan

    Sum of Date Difference based on the unique value in another column

    Usman Ali

      Sum of Date Difference based on the unique value in another column

       

      I have column in data "PO_Number" which is repeating.

       

      I have date_from and Date_to columns in data.

       

      I want to calculate the days between date_from and date_to but only consider the one po line one time.

       

      example:

       

      PO_number          Date_From          Date_to               Diff

      100                         01/01/2010          05/01/2010          5

      100                         01/01/2010          05/01/2010          5

      200                         01/01/2010          10/01/2010          10

      200                         01/01/2010          10/01/2010          10

       

      Expected result:

       

      PO_Number          Diff

      100                         5

      200                         10

                               Sum(diff) = 15

       

      Please guide to achieve.

       

      Regards,

       

      Usman