Looking to create running totals for ungrouped data in SQL. I’m looking to do a rolling sum of PAID_AMOUNT by INCURREDMONTH and PAIDMONTH. For example,
incurred month = 1/1/2022 and paid month = 1/1/2022 should be the sum of everything incurred and paid with values of 1/1/2022.
incurred month = 1/1/2022 and paid month = 2/1/2022 should be the sum of everything incurred in paid months 1/1/2022 AND 2/1/2022.
Data Set
Desired Output
Could not figure this out for the life of me.
Jacky Mei is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.