Iterate over Notion database rows for date logic

Hey everybody,

I want to build a monthly finance planner with two databases in Notion.

Database 1 contains the amount of money that gets sent to or deducted from my account at a specific date.

Database 2 should be calculated dynamically based on Database 1, and it should reflect the current balance (cumulative amount of Database 1) at a specific date. The date range is just each day in the month.

  • Database 1

    • Date
    • $ Amount incoming (+) or outgoing (-) at Date
  • Database 2

    • Date (<- manually created range over one month)
    • $ Balance at Date ← HOW TO CALCULATE THIS :cold_face:

As this is only the most basic use case, I would like to know how to achieve this, preferably with some sort of scripting by iterative over the rows of both tables.

In a future version, I want to include recurring payments.

Is there any way to do this in Notion? I am grateful for ANY help. Thank you!
– Paul

Hi there!

Regarding your desired case. Can you please send me a screenshot sample of what your database column looks like and the sample values?

Also, what can be the identifier of that specific item in the Database 2? For example The identifier is some sort of ID. The reason for this is that suppose The trigger (from Database 1) receives the data and then we will then need to search for the equivalent item in Database 2. Once the item is found then update/calculate the balance at date?

What I’m thinking here is that you’ll also need to have a DataStore module (this will be a separate Scenario as you mentioned that a certain item’s amount will be deducted on a specific date).

In calculating figures, you’ll need to use the Math function:

2 Likes