Relationship Between Rollup Fields and Link Fields
Rollup fields depend on previously created link fields. Through link fields, rollup fields can âseeâ related records in another table and perform various calculations on them.
After performing rollups, you can not only get calculation results but also format these results and configure interactive displays to make them more readable and understandable. Formatting allows you to present rollup data in specific styles and formats, while interactive displays let you configure different UI and interaction options for calculation results. This not only makes data more readable but also helps ensure data consistency across different contexts and application scenarios.
How to Create a Rollup Field?
- In a table with a link field, select âAdd Field,â then choose âRollup Field.â
- Select an existing link field to determine the data source for the rollup.
- Choose the field you want to roll up, then specify the aggregation operation to perform (complete list of operations below).
Rollup Field Use Cases and Examples
Letâs say youâre managing a bookstore database with two tables:
Table A: Orders
Table B: Books
The Orders table records customer purchase information, while the Books table contains pricing for each book.
If you want to sum up the total amount for each order, you can:
- Create a link field in the âOrdersâ table linking to the âBooksâ table.
- Then, create a rollup field in the âOrdersâ table, selecting the link field created in the previous step.
- Specify âSUMâ as the rollup operation and select the price field from the âBooksâ table as the target for rollup.
Letâs look at two tables: a âBook Detailsâ table and an âOrdersâ table.
Book Details Table
| Book Title | Price |
|---|
| âCode Completeâ | $60 |
| âDesign Patternsâ | $40 |
| âRefactoringâ | $50 |
In this table, we list the price of each book.
Orders Table
| Order No. | Books (Link Field) | Total Amount (Rollup Field) |
|---|
| 001 | âCode Completeâ, âDesign Patternsâ | $100 |
| 002 | âRefactoringâ, âDesign Patternsâ | $90 |
In the Orders table, when we select certain books, the rollup field automatically calculates the total price of the selected books:
- For order 001, we selected âCode Completeâ and âDesign Patternsâ, priced at 60and40 respectively, so the total amount rollup field shows $100.
- For order 002, we selected âRefactoringâ and âDesign Patternsâ, priced at 50and40 respectively, so the total amount rollup field shows $90.
Through this combination of link fields and rollup fields, we can easily automatically calculate the total amount for each order in the Orders table without manual input or calculation.
| Formula Name | Explanation |
|---|
| COUNTALL | Counts all values, including empty and non-empty values |
| COUNTA | Counts non-empty values |
| COUNT | Counts the number of records |
| SUM | Calculates the sum of all numeric values |
| MAX | Returns the maximum value among all numbers |
| MIN | Returns the minimum value among all numbers |
| AND | Returns true if all values are true |
| OR | Returns true if any value is true |
| XOR | Returns true if an odd number of values are true |
| ARRAY_JOIN | Joins all values in an array into a string |
| ARRAY_UNIQUE | Removes duplicates from an array and returns a new array with unique values |
| ARRAY_COMPACT | Removes all empty values from an array and returns a new array |
| CONCATENATE | Joins multiple values into a string |
Important Notes
- Performance Considerations: Large numbers of rollup operations may affect performance, especially when dealing with many data records. The system will provide the fastest possible calculation speed, but periodically optimizing and reviewing your rollup settings can better ensure application write performance.
- Rollup Formulas: Rollup fields will automatically provide allowed rollup formulas based on the data type of your selected rollup field, so you wonât always see all rollup formulas.
Conclusion
Rollup fields are one of the powerful data analysis tools, reducing the burden of manual summarization and data updates through automated calculations. They provide a quick and flexible way to view and analyze aggregate information from related data.Last modified on January 23, 2026