Rollups help you aggregate data in your databases based on relations.
Going back to our customers and items example in database relations, let's say you wanted to know how much each customer spent based on what they bought.
- First, create the relation so you know who bought what.
- Add a new column/property and choose
Rollup
from theProperty type
menu. Give it a descriptive name.
- Clicking on any cell in the rollup column will bring up a new menu asking you for:
- The relation property you want to roll up.
- The property of those related pages you want to roll up.
- The calculation you want to apply to them.
- So, for our example, you'd choose to roll up the relation property
Items Purchased
and thePrice
property within those pages. Then you'd chooseSum
as the calculation. - Doing this adds up the prices of each item related to a customer's name, giving you the total dollars they spent in your rollup column.
Rollup types
There are 17 different calculations you can apply as a rollup. Here are all of them:
Show original
: This just shows all related pages in the same cell. It's the same as the relation property itself.
Show unique values
: This shows each unique value in the selected property for all related pages.
Count all
: Counts the total number of values in the selected property for all related pages.
Count unique values
: Counts the number of unique values in the selected property for all related pages.
Count empty
: Counts the number of related pages with an empty value for the property selected. So, if one item a customer bought didn't have a price and that was the property selected, the rollup column would say 1.
Count not empty
: Counts the number of related pages with assigned values for the property you selected.
Percent empty
: Shows the percentage of related pages with no value in the property you selected.
Percent not empty
: Shows the percentage of related pages with a value in the property you selected.
These rollup calculations are only available for Number
properties:
Sum
: Computes the sum of the numeric properties for related pages (like above).
Average
: Computes the average of the numeric properties for related pages.
Median
: Finds the median of the numeric properties for related pages.
Min
: Finds the lowest number in the numeric property for related pages.
Max
: Finds the highest number in the numeric property for related pages.
Range
: Computes the range between the highest and lowest numbers in the numeric property for related pages (Max
-Min
).
These rollup calculations are only available for Date
properties:
Earliest date
: Finds the earliest date/time in the date property for all related pages.
Latest date
: Finds the latest date/time in the date property for all related pages.
Date range
: Computes the span of time between the latest and earliest dates in the date property for related pages.
Aggregate rollups
In both tables and boards, you can apply calculations to your rollup column to get a sense of sums, ranges, averages, etc. for your entire database.
- Let's say you want to find the total money spent by all customers in our example.
- At the bottom of your Customers table, under your rollup column, click
Calculate
.
- Choose
Sum
to add all the values in that column together and get a grand total.
Fast Track Your Mastery
Learn the principles behind our systems and build together with us in our new “Making Of…” YouTube series (coming soon!) designed to help you go from zero to hero with our tools.
If you'd like a personalized approach, we offer 1-on-1 support with setting up your system from scratch and customization of your system to fit your unique life.
Was This Helpful?
If you still have questions, let us know how we can help! If you'd have any thoughts or feedback to improve this article, please click the bookmark below to access the Notion page powering this article and make suggestions.
Thank you for helping our family level up!