I have the following sample data-set where I need to find the rows where overdue_amount drops to zero while loan_balance column increases by the same amount per loan_id. For instance, the rows 2-> 3, 7 -> 8, 11 -> 12
report_date customer_id loan_id Overdue_Amount Loan_Balance Flag_1
01/01/20 1 12 125000 0 0
02/01/20 1 12 125000 0 1
03/01/20 1 12 0 125000 1
04/01/20 1 13 0 125000 0
05/01/20 1 13 0 125000 0
01/01/20 2 111 0 0 0
02/01/20 2 111 6000 0 1
03/01/20 2 111 0 6000 1
04/01/20 2 112 0 6000 0
01/01/20 3 131 165878 0 0
02/01/20 3 131 165878 0 1
03/01/20 3 131 0 165878 1
04/01/20 3 132 9000 10000 0
05/01/20 3 132 9000 10000 0
06/01/20 3 132 9000 10000 0
07/01/20 3 132 9000 10000 0