All topics
Get started8Account, team & permissions44Units & fields70Records, views & tasks39WhatsApp & Cortex Chat68Email & social27Lead ads & distribution38Automations52Documents & quotes32Dashboards40Cortex AI18Developers & API12
Help Center·448 guidesAll topicsContact support

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.

7 min
Before you start · 1 thing · for owners
A Has many relation from this unit
  • You need: The permission to edit units
  • A Has many relation from this unit.

Steps

1
Open Add Field and choose Rollup from the Relation tab.
2
Choose the relation in Records to total up.
3
Choose the function in Aggregate, then the field in the linked records in Field to total up (except for a count).
4
Choose the result type, the decimal places and the currency.
5
Set how empty values are handled.
6
Save.
The values are calculated for all existing records in the background.

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

Function
Result
Sum
The values added together
Count
The number of linked records
Average
The sum ÷ the number of records that have a value
Min
The lowest value there is
Max
The highest value there is

Fields that can be rolled up: Number, Currency, another Rollup, and a Calculation whose result is a number, a currency or a percentage.

Settings

Setting
Options
Result type
Number or currency
Decimal places
0 to 10
Currency
With the currency type
When a record has no value
Skip the record (default), or Count it as 0
When there are no records to average
Show nothing, Show 0 or Show a notice

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

What you see
Why
What to do
“A rollup needs a to-many relation”
The relation is to one record.
Use a Lookup field.
A message that the field type can’t be rolled up
A text, rating or date field.
Choose a numeric field.
A message that the rollup would read its own value
A loop in the chain.
Change the field being rolled up.
A message about going past 3 levels
The chain is too long.
Shorten the chain.
The number didn’t change right away
The update runs in the background.
Wait a few seconds and refresh the page.
The value is empty after the relation was deleted
Deleting it empties the rollup.
Create the relation and the links again.

A real example

Shield Security Co.
The situation

The manager wants to know how many visits were done on each contract.

What they did
  1. In “Contracts”, a rollup: the count of visits.
  2. Another rollup: the sum of “Visit cost”.
  3. A calculation: {contract_value} - {visits_cost} for the profit.
The result

Every contract shows its visits and its profit, without Excel.

A made-up company, to show the idea. The numbers are rounded.

Good to know

It needs a Has many relation. For a relation to one record, use Lookup.
Up to 3 levels of rollups in a row, and loops aren’t allowed.
Rating, Serial Number and date fields can’t be rolled up.
Deleting the relation empties the values.
Did this guide solve it?
If not, we’ll ask what was missing.
Open in Corteksa
Did this guide solve it?

We read every answer. To get a reply, use Contact support.