I am trying to make a financial dashboard. I have currently 4 databases. Accounts, Expense, Income and Budget. I am trying to display monthly income in my accounts table using rollup but i keep getting the sum of current and past months. Any advice on how to solve this?
Connect
2 Answers
Plain rollups can't filter by date, so you get the sum of every month. A formula on the Accounts database can filter the relation instead. Assume the relation to Income is called "Income" and has Date and Amount:
prop("Income")
.filter(formatDate(current.prop("Date"), "YYYY-MM") == formatDate(now(), "YYYY-MM"))
.map(current.prop("Amount"))
.sum()
Name it Income this month. Make the same formula for Expense, and Net = Income this month − Expense this month.
For past months, add a Date property called "Month" to the account (or the dashboard row) and compare it against that instead of now(). Another option is a Months database (one row per month) related to each transaction, where a plain rollup Sum works per month.
For a quick visual, a chart view on Income grouped by Date (month) also works.
Free template with the client and project side of a freelance setup: https://2rds.github.io/freelancer-ops/lite.html?ref=notionanswers
Related questions
- How do you select to display only positive numbers from a rollup
- formula, formula, rollup error
- And if you wanted to get the last word from a rollup, containing multiple commas??
- Budget by month (Rollup adding all months, can't separate entries)
- APP IOS - Database Rollup Poperty - Hyperlink not working
Without Answer
-
- 124
- 0
- Oct 3
-
- 317
- 0
- Aug 12
-
- 357
- 0
- Aug 7
-
- 469
- 0
- Jul 17
-
- 1557
- 0
- Apr 14
-
- 1061
- 0
- Apr 10
-
- 1092
- 0
- Apr 7
-
- 1034
- 0
- Apr 6
- see all
Recent Activities
freelancerops answered 1 day ago
Recurring bills - monthly valuesfreelancerops answered 1 day ago
Budget by month (Rollup adding all months, can't s…freelancerops answered 1 day ago
How do i rollup by monthsfreelancerops answered 1 day ago
How might I create a header/detail page?freelancerops answered 2 days ago
Linking Databases

