Hi Alteryx Community,
I have the following situation that I need assistance in solving.
Person, Credit/Debit, Amount, Start, End
A, Credit, 1000, 1/1/21, 1/5/21
A, Debit, 500, 1/3/21, 1/6/21
B, Credit, 1000, 1/1/21, 1/20/21
B, Credit, 2000, 1/4/21, 1/20/21
B, Debit, 1500, 1/10/21, 1/20/21
I need to create a workflow that can run through these different situations:
First, take the debit and compare it with the first credit.
- If the debit amount is greater than the credit, we want to do 2 things:
- We want to change the end date of the credit to the start date of the debit
- Take the remaining debit balance and apply it to the next credit in the Person's history (repeat for as many needed)
- If the debit amount is less than the credit, we want to do 2 things;
- We want to change the end date of the credit to the start date of the debit
- Create a new row with the amount being credit – debit balance, the start date of debit and the end date of the credit
Thanks for your help in advance