Conditional rollup for budget expenses by year

I’m looking to build something that seems pretty straightforward, but yet, I’m unable to achieve.

I want to manage yearly budgets and add expenses that are linked to a specific budget year. This part is pretty simple with a budget table with a record for every year, and another table for expenses where I specify the amount and the budget it is linked to.

Where I’m having trouble is having the SUM amount of all the expense records linked to that year. within the budget table. I would use a rollup field a configure a SUM of the amount field within the connected expense table, but I can only hard code a specific value and not dynamically link it to the corresponding year.

Example :

In the Expenses table :

Expense 1 | $300.00 | Year 2025

Expense 2 | $500.00 | Year 2024

In the Budget table :

Year 2024 | [SUM amount expenses for 2024]

Year 2025 | [SUM amount expenses for 2025]

But in the rollup field, there it is not possible to create a condition based on the year field value.

Is there another way to achieve this? It’s a pretty simple budget management feature as I see it.

Thank you!

Follow that format, in rollup @manuel.patry

@manuel.patry rollup is very flexible, just need to tweak correctly.

Hello @TadaMan

Thank you for your quick reply, it’s the first time somebody actually takes the time (in my experience).

I’m a bit clueless why it was not working in the first time, I’m under the impression I did exactly the same thing, but now it is working. I did not realized that the SUM function in rollup already take the adjacent field value in consideration.

Tks!

The rollup field is a perfect option. I only caution using the rollup if you have an enormous amount of records that the rollup field is “rolling up”. If you have thousands or more records the rollup field will could have issues and hang your app up.

If the numerous records is not an issue, then the rollup will work just right.

Adam