- Make sure you record the user’s ID/email.
- Use a query column, filter by user’s ID/email equals to this row > user’s ID/email.
- Add a rowID column to your table.
- Add a lookup column on top of the query result, pointing to that rowID column, so you get an array of IDs for the same user.
- Add a find element index column, use the lookup result as the base, and look for the current row’s rowID. You will get a 0-based list of index for each user.
- Add a math column, with the formula being: I-1, with I being the index of the current row. This will give you the index of the previous row from the same user.
- Add a query column, use the query from the 2nd step as a base, filter by index equals to this row > previous row’s index.
- Add a single column to fetch the first “EndBal” from the query above.
Now you got the EndBal from the previous row, you can proceed with calculating other things within your structure.