Sum, count or average linked records with a Rollup field
On the parent record, work out the sum, count, average, smallest or largest value of a field in its linked records, and it updates automatically when they change.
Before you start · 1 thing · for ownersA Has many relation from this unit
- You need: The permission to edit units
- A Has many relation from this unit.
Steps
Deactivating the relation, or deleting or deactivating the field being rolled up, can leave the last calculated number showing without updates. Set up the rollup again, or delete it.
Functions
Fields that can be rolled up: Number, Currency, another Rollup, and a Calculation whose result is a number, a currency or a percentage.
Settings
Min and Max of nothing give empty, not zero.
Currencies are added up as they are, with no conversion.
When does it update?
In the background, a few seconds after a linked record is edited, added, deleted or moved to another parent. Moving a record updates both parents. It also updates when the links change from the parent’s side.
Updating a rollup doesn’t change the parent’s last-modified date, and doesn’t show as an edit on the record.
Changing the relation, the field or the function recalculates every value. Changing only the decimal places or the currency doesn’t.
Chains
A rollup can add up another rollup, or a calculation that reads a rollup. For example: the total paid on an invoice = the sum of its payments, and the client’s balance = the sum of what’s been paid on their invoices. Chains are checked every night to keep them accurate.
Use a rollup in formulas as a number: {pipeline_total} * 0.15.
Who sees the number?
A rollup counts every linked record, even the ones the user can’t see. The number is the same for everyone who can see the parent record.
If something goes wrong
A real example
The manager wants to know how many visits were done on each contract.
- In “Contracts”, a rollup: the count of visits.
- Another rollup: the sum of “Visit cost”.
- A calculation:
{contract_value} - {visits_cost}for the profit.
Every contract shows its visits and its profit, without Excel.