I am working through finalizing a process to determine which transactions on an account we are writing off.
I have looked at all financial transactions that are revenue in nature. I have sorted the data in descending order and done a running total on this. Ultimately I am looking to grab all transactions that are within - a certain dollar value from their account balance and then I can do an adjustment for any differences.
Any suggestions on a more efficient way of tackling this would be awesome.
Was thinking something like
If row 0 (running total) <= then INCLUDE="YES"
If row 0 + 1 (running total) <= then INCLUDE = "YES"
There is however a chance that there are multiple times in an account where the running balance is within the right parameters but really want the first instance this happens and include all transactions up to that point without going over (unless the following transaction is a significant portion of the balance of the account)
We have tried to grab the date that belongs to that first transaction however there could be other transactions on the same date that we do not want brought into the final dataset.