Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions content/docs/fields/field-types/links-based/rollup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ keywords: ['Fields', 'Field types', 'Links based types', 'Rollup', 'Create rollu
4. Select the link field from the dropdown. This is the field that links the current table to the related table.
5. Select the field for display from the dropdown. This is the field that will be displayed in the current table.
6. Select the aggregation function from the dropdown. This is the function that will be used to aggregate the data.
7. Click on `Save Field` button.
7. Set the **Precision** (Optional) to number of decimal places to display for numeric aggregation functions.
8. Enable the **Thousand Separator** (Optional) to format the number with a thousand separator.
9. Click on `Save Field` button.

![image](/img/v2/fields/types/rollup.png)

### Aggregation Functions
### Aggregation functions
Here's a table with brief descriptions for each of the aggregation functions supported by NocoDB:

| Aggregation Function | Description |
Expand All @@ -33,6 +35,21 @@ Here's a table with brief descriptions for each of the aggregation functions sup
| Sum Distinct | Adds up all the distinct values in a dataset. |
| Average Distinct | Calculates the average of distinct values in a dataset. |


### Rollup count as link

When using a rollup field with the **Count** function, you can enable the **"Show count as links"** option to make the displayed count clickable. This allows users to directly access and view the underlying linked records that contribute to the count. Once enabled, the rollup field becomes editable, allowing you to add or modify records in the linked table directly from the rollup field.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can make it "count function on primary key"


![image](/img/v2/fields/types/rollup-count-as-link.png)

Additionally, you can configure "Singular label" & "Plural label" for the rollup field. These labels will be used to display the count in a more user-friendly manner, such as "1 record" or "5 records".

Rollup count as link is available only for the `Count` aggregation function & with `ID` field type selected as the related table field during rollup creation.

<Callout type="info">
API response for rollup field will always return the count as a number, regardless of whether the "Show count as links" option is enabled or not. If you need to retrieve the linked records, you can use associated `LinkToAnotherRecord` field type instead.
</Callout>

## Similar links-based fields
- [Links](links)
- [Lookup](lookup)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/img/v2/fields/types/rollup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.