14 Replies Latest reply on Dec 5, 2018 12:24 PM by Ken Flerlage

    Sum of values on Max Date

    bob j

      Hi Experts , above is the sample data..


      From above data , days = end-date-start_date filtered for March month. We can see id's 7 & 9 , they appeared twice , they  have same start-date but difference in end_date. When i do SUM(days) for everything it is giving 59 days .. But my requirement is , I needed only days for Max(end_date) if we do SUM(days) , ie., now total for SUM(days) would be 55 days ,as i dont want to consider days for Min(end_date) for id's 7 & 9.


      in detail , for id 7 , if we do end-date-start_date we get number of days as 2 & 3. I want to consider only highest value ie., 3 from id 7 when i do Sum(days).


      Please help , thank you.