I am new to glide and I am trying to create an expense tracker for my personal use, just to get off the ground with a real project.
I have the following columns:
date, amount,balance, category.
When I enter the amount, I want the balance to be updated by taking the previous balance (from the previous row). Sometimes, I just want to enter the balance and want an entry made for the amount.
Should I create balance as an explicit column in my table (and a typical excel formula to take the previous row value and subtract the amount to get the value for current row) , or should I use a calculated field (something like a running calculation in DB terms) - any guidance or pointers would be appreciated.
Assuming you store the amounts in the same column (positive and negative, accordingly), it would just be a rollup on top of a relation to sum that column, but as Xavier said, we might have a better recommendation if you show us your data structure.
Here is a screenshot from the google sheets I am using. When the user enters the amount, the balance should be displayed to him - here when he enters 200, he should see the closing balance as 19,300 by taking the opening balance of 19500 (from the previous entry) and deducting the 200.
Not having to define the related balance for each individual record is a lot easier though.
The user may need to see the balance only when he adds a new expense.
I’d probably write the previous balance when creating each row, then use a math column to figure out the new balance based on the credit or debit.
You could get that previous balance before creating a new row by using a Single Value column or a Rollup column. Either way you should have a balance value that you can pass through a form when you write a new row, and then the math column will give you the new balance.