Rollup

A Rollup field aggregates data from fields in the related table. Use it to calculate totals, averages and other aggregate data.

Ask NocoAI

Copy a prompt, paste it into NocoAI in any base, and replace the words in [brackets] with your own.

  • Add a field to [Customers] that totals [Amount] across their [orders]
  • Add a field to [Projects] that counts their linked [tasks]
  • Add a field that shows the latest [Order Date] for each [customer]

Create a Rollup Field

  1. Click the + icon to the right of the Fields header.
  2. In the dropdown modal, enter the field name (optional).
  3. In the dropdown, select the field type Rollup.
  4. In the dropdown, select the link field. This field links the current table to the related table.
  5. In the dropdown, select the field to show. The current table shows this field.
  6. In the dropdown, select the aggregation function. NocoDB uses this function to aggregate the data.
  7. Click the Save Field button.

image

Aggregation Functions

NocoDB supports these aggregation functions:

Aggregation FunctionDescription
CountCounts the number of records in a dataset.
MinimumReturns the minimum value in a dataset.
MaximumReturns the maximum value in a dataset.
AverageCalculates the average value in a dataset.
SumAdds up all the values in a dataset.
Count DistinctCounts the number of distinct values in a dataset.
Sum DistinctAdds up all the distinct values in a dataset.
Average DistinctCalculates the average of distinct values in a dataset.

Conditional Rollup ☁

Conditional rollup is available on NocoDB Cloud (Plus plan and above) and licensed self-hosted deployments (Business plan and above).

A Rollup field does calculations, such as sum, average and count, on linked records from a related table. By default, the rollup includes all linked records. But you can include only the records that meet specific conditions.

To do this, turn on the option: Only include linked records that meet specific conditions

This option filters the linked records before NocoDB does the rollup calculation. Use it to aggregate values with a condition. For example, sum the revenue for a period, or count the items that meet a threshold.

Applying filters

  1. Turn on Only include linked records that meet specific conditions.
  2. Click Add filter. Define the condition or conditions with fields from the related table.
  3. To combine filters with AND/OR logic, use Add filter group.
  4. Click Save Field. NocoDB applies the filters.

Last updated on

Latest product updates?See Changelog
Stay in the loop? Follow us onLinkedInLinkedInYouTubeYouTubeXX