Hi
I have the following data (this is an example - there are approx 45000 rows in the original doc which will only increase with time!):
[TABLE="width: 348"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]Cust No[/TD]
[TD]End of Period Date[/TD]
[TD] Carried Forward Balance[/TD]
[/TR]
[TR]
[TD]JH3[/TD]
[TD]2019-01-07[/TD]
[TD="align: right"]1032.06[/TD]
[/TR]
[TR]
[TD]JH3[/TD]
[TD]2018-12-07[/TD]
[TD="align: right"]1130.82[/TD]
[/TR]
[TR]
[TD]JH3[/TD]
[TD]2018-12-07[/TD]
[TD="align: right"]1732.06[/TD]
[/TR]
[TR]
[TD]JH3[/TD]
[TD]2018-12-07[/TD]
[TD="align: right"]1132.06[/TD]
[/TR]
[TR]
[TD]JH3[/TD]
[TD]2018-11-12[/TD]
[TD="align: right"]1230.82[/TD]
[/TR]
[TR]
[TD]RB5[/TD]
[TD]2019-01-07[/TD]
[TD="align: right"]1182.76[/TD]
[/TR]
[TR]
[TD]RB5[/TD]
[TD]2018-12-07[/TD]
[TD="align: right"]1082.76[/TD]
[/TR]
[TR]
[TD]RB5[/TD]
[TD]2018-12-07[/TD]
[TD="align: right"]982.76[/TD]
[/TR]
[TR]
[TD]RB5[/TD]
[TD]2018-12-07[/TD]
[TD="align: right"]40.14[/TD]
[/TR]
[TR]
[TD]RB5[/TD]
[TD]2018-11-12[/TD]
[TD="align: right"]611.45[/TD]
[/TR]
[TR]
[TD]RB5[/TD]
[TD]2018-10-03[/TD]
[TD="align: right"]-1.17[/TD]
[/TR]
[TR]
[TD]RB5[/TD]
[TD]2018-09-04[/TD]
[TD="align: right"]570.14[/TD]
[/TR]
[TR]
[TD]RB5[/TD]
[TD]2018-08-14[/TD]
[TD="align: right"]40.14[/TD]
[/TR]
[TR]
[TD]RB5[/TD]
[TD]2018-07-04[/TD]
[TD="align: right"]-1.17[/TD]
[/TR]
[TR]
[TD]YT6[/TD]
[TD]2019-01-07[/TD]
[TD="align: right"]1020.53[/TD]
[/TR]
[TR]
[TD]YT6[/TD]
[TD]2018-12-07[/TD]
[TD="align: right"]1020.53[/TD]
[/TR]
[TR]
[TD]YT6[/TD]
[TD]2018-12-07[/TD]
[TD="align: right"]1020.53[/TD]
[/TR]
[TR]
[TD]YT6[/TD]
[TD]2018-12-07[/TD]
[TD="align: right"]510.25[/TD]
[/TR]
[TR]
[TD]YT6[/TD]
[TD]2018-11-12[/TD]
[TD="align: right"]1020.53[/TD]
[/TR]
[TR]
[TD]YT6[/TD]
[TD]2018-10-03[/TD]
[TD="align: right"]510.25[/TD]
[/TR]
[TR]
[TD]YT6[/TD]
[TD]2018-09-04[/TD]
[TD="align: right"]-0.03[/TD]
[/TR]
[TR]
[TD]YT6[/TD]
[TD]2018-08-14[/TD]
[TD="align: right"]510.25[/TD]
[/TR]
[TR]
[TD]YT6[/TD]
[TD]2018-07-04[/TD]
[TD="align: right"]-0.03[/TD]
[/TR]
[TR]
[TD]YT6[/TD]
[TD]2018-06-05[/TD]
[TD="align: right"]-0.03[/TD]
[/TR]
</tbody>[/TABLE]
I am trying to find the length of time in days that the customer has been in arrears from the most recent end of period date - i.e. back to where their account goes into credit (if it does) or until their account was opened if it has always been in debt. I'm only interested in the current instance of debt (i.e. it doesn't matter if they have been in arrears before) and would like the data to look like this:
[TABLE="width: 162"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]Cust No[/TD]
[TD]Days in arrears[/TD]
[/TR]
[TR]
[TD]JH3[/TD]
[TD="align: right"]56[/TD]
[/TR]
[TR]
[TD]RB5[/TD]
[TD="align: right"]56[/TD]
[/TR]
[TR]
[TD]YT6[/TD]
[TD="align: right"]96[/TD]
[/TR]
</tbody>[/TABLE]
The data is exported out and refreshed, so needs to be able to cope with this.
Any help is much appreciated!
Thank you
Jenny
I have the following data (this is an example - there are approx 45000 rows in the original doc which will only increase with time!):
[TABLE="width: 348"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]Cust No[/TD]
[TD]End of Period Date[/TD]
[TD] Carried Forward Balance[/TD]
[/TR]
[TR]
[TD]JH3[/TD]
[TD]2019-01-07[/TD]
[TD="align: right"]1032.06[/TD]
[/TR]
[TR]
[TD]JH3[/TD]
[TD]2018-12-07[/TD]
[TD="align: right"]1130.82[/TD]
[/TR]
[TR]
[TD]JH3[/TD]
[TD]2018-12-07[/TD]
[TD="align: right"]1732.06[/TD]
[/TR]
[TR]
[TD]JH3[/TD]
[TD]2018-12-07[/TD]
[TD="align: right"]1132.06[/TD]
[/TR]
[TR]
[TD]JH3[/TD]
[TD]2018-11-12[/TD]
[TD="align: right"]1230.82[/TD]
[/TR]
[TR]
[TD]RB5[/TD]
[TD]2019-01-07[/TD]
[TD="align: right"]1182.76[/TD]
[/TR]
[TR]
[TD]RB5[/TD]
[TD]2018-12-07[/TD]
[TD="align: right"]1082.76[/TD]
[/TR]
[TR]
[TD]RB5[/TD]
[TD]2018-12-07[/TD]
[TD="align: right"]982.76[/TD]
[/TR]
[TR]
[TD]RB5[/TD]
[TD]2018-12-07[/TD]
[TD="align: right"]40.14[/TD]
[/TR]
[TR]
[TD]RB5[/TD]
[TD]2018-11-12[/TD]
[TD="align: right"]611.45[/TD]
[/TR]
[TR]
[TD]RB5[/TD]
[TD]2018-10-03[/TD]
[TD="align: right"]-1.17[/TD]
[/TR]
[TR]
[TD]RB5[/TD]
[TD]2018-09-04[/TD]
[TD="align: right"]570.14[/TD]
[/TR]
[TR]
[TD]RB5[/TD]
[TD]2018-08-14[/TD]
[TD="align: right"]40.14[/TD]
[/TR]
[TR]
[TD]RB5[/TD]
[TD]2018-07-04[/TD]
[TD="align: right"]-1.17[/TD]
[/TR]
[TR]
[TD]YT6[/TD]
[TD]2019-01-07[/TD]
[TD="align: right"]1020.53[/TD]
[/TR]
[TR]
[TD]YT6[/TD]
[TD]2018-12-07[/TD]
[TD="align: right"]1020.53[/TD]
[/TR]
[TR]
[TD]YT6[/TD]
[TD]2018-12-07[/TD]
[TD="align: right"]1020.53[/TD]
[/TR]
[TR]
[TD]YT6[/TD]
[TD]2018-12-07[/TD]
[TD="align: right"]510.25[/TD]
[/TR]
[TR]
[TD]YT6[/TD]
[TD]2018-11-12[/TD]
[TD="align: right"]1020.53[/TD]
[/TR]
[TR]
[TD]YT6[/TD]
[TD]2018-10-03[/TD]
[TD="align: right"]510.25[/TD]
[/TR]
[TR]
[TD]YT6[/TD]
[TD]2018-09-04[/TD]
[TD="align: right"]-0.03[/TD]
[/TR]
[TR]
[TD]YT6[/TD]
[TD]2018-08-14[/TD]
[TD="align: right"]510.25[/TD]
[/TR]
[TR]
[TD]YT6[/TD]
[TD]2018-07-04[/TD]
[TD="align: right"]-0.03[/TD]
[/TR]
[TR]
[TD]YT6[/TD]
[TD]2018-06-05[/TD]
[TD="align: right"]-0.03[/TD]
[/TR]
</tbody>[/TABLE]
I am trying to find the length of time in days that the customer has been in arrears from the most recent end of period date - i.e. back to where their account goes into credit (if it does) or until their account was opened if it has always been in debt. I'm only interested in the current instance of debt (i.e. it doesn't matter if they have been in arrears before) and would like the data to look like this:
[TABLE="width: 162"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]Cust No[/TD]
[TD]Days in arrears[/TD]
[/TR]
[TR]
[TD]JH3[/TD]
[TD="align: right"]56[/TD]
[/TR]
[TR]
[TD]RB5[/TD]
[TD="align: right"]56[/TD]
[/TR]
[TR]
[TD]YT6[/TD]
[TD="align: right"]96[/TD]
[/TR]
</tbody>[/TABLE]
The data is exported out and refreshed, so needs to be able to cope with this.
Any help is much appreciated!
Thank you
Jenny