Traditional spreadsheets like Excel and Google Sheets break running totals when rows are inserted or deleted, because formulas reference fixed cells. Airtable, Baserow, and Notion databases lack row-level context, forcing manual links or scripts. SQL offers window functions like LAG and SUM() OVER, but they’re developer-centric.
Grist solves this with PREVIOUS(), a formula that calculates cumulative values based on a specified order, such as date. It handles insertions, deletions, and filtering gracefully. You can also group by fields like card member to track individual balances.
PREVIOUS() keeps logic in the formula, not the view, ensuring accuracy across sorting and filtering. Its siblings NEXT() and RANK() offer forward-looking and positional calculations, making Grist a powerful alternative for relational data in a spreadsheet form.
Source: Hacker News · Summarized by HeadlinesBriefing