The issue is the result of that segment will sum all the records of all backup_date till backup_date='31/01/2018' then from 31/01 to 28/02 while i only need to calculate exactly the sum of paid_money in each day which i have added to to column like 30/01, 28/02 and .... Can someone guide me to solve this issue.