Skip to content

icon picker
previousRow()

and why you should not use it in Coda
In a database, data is typically stored in tables, and each row in a table represents a unique record or entity. The rows in a table are not necessarily ordered or linked in any particular way, so there may not be a clear concept of a "previous" row for a given record.
In addition, relying on a previous row concept can make it more difficult to insert, update, or delete records in the database, as these operations may require shifting or updating multiple rows in the table.
Instead of relying on a previous row concept, databases typically provide other mechanisms for working with data, such as querying and filtering data based on specific criteria, or using transactional operations to ensure data consistency and integrity.
Unlike a spreadsheet, Coda has for good reasons - as you may understand based on the above - not a previousRow() function. There is no need for. In the context of interest calculations we apply the function Power() while when we deal with tracking sales, growth etc we use the concept of talking tables (transactional operations) and via buttons we make sure data remains aligned.
On the page you see how easy you can simulate a previousRow() logic. The coda code snippets are simple and your tables remain relative fast. Not as fast as in a spreadsheet. Spreadsheets are made for linking individual cells and their performance does not suffer when you reference a previous row. Coda tables on the other hand do suffer seriously. However feel free to implement on the page you see you can present something nicely.
In this blog some details you may like: ⤵️
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.