2205 Rollup Fields And Aggregations
Rollup Fields and Aggregations
Introduction
What Are Rollup Fields?
Key Characteristics
- Aggregate Function: Perform calculations across multiple records
- Connection-Based: Work with related records through connection fields
- Automatic Updates: Recalculate when related records change
- Read-Only: Cannot be manually edited
- Real-Time: Always reflect current data
Rollup vs Equation
| Rollup Field | Equation Field |
| Calculates across multiple related records | Calculates within single record |
| Requires connection field | Uses fields in same table |
| Aggregation functions (SUM, COUNT, AVG) | Math and text functions |
| Example: Total of all order line items | Example: Quantity × Price |
Rollup Aggregation Functions
1. SUM
Adds up values from all connected records.
When to Use
- Total revenue from all orders
- Sum of all invoice amounts
- Total hours worked
- Combined inventory value
Example
Customer table: "Total Order Value"
- Rollup: SUM
- Connection: Orders
- Field to Sum: Order Total
- Result: Sum of all order totals for that customer
2. COUNT
Counts number of connected records.
When to Use
- Number of orders per customer
- Total tasks in project
- Count of employees in department
- Number of products in category
Example
Customer table: "Total Orders"
- Rollup: COUNT
- Connection: Orders
- Result: Number of orders for that customer
3. AVERAGE (AVG)
Calculates average value across connected records.
When to Use
- Average order value
- Mean test score
- Average project duration
- Mean product rating
Example
Customer table: "Average Order Value"
- Rollup: AVG
- Connection: Orders
- Field to Average: Order Total
- Result: Average of all order totals
4. MINIMUM (MIN)
Finds lowest value among connected records.
When to Use
- Earliest date
- Lowest price
- Minimum score
- First order date
Example
Customer table: "First Order Date"
- Rollup: MIN
- Connection: Orders
- Field: Order Date
- Result: Date of first order
5. MAXIMUM (MAX)
Finds highest value among connected records.
When to Use
- Most recent date
- Highest price
- Maximum score
- Last order date
Example
Customer table: "Last Order Date"
- Rollup: MAX
- Connection: Orders
- Field: Order Date
- Result: Date of most recent order
Creating Rollup Fields
Step 1: Ensure Connection Exists
Rollup fields require a connection between tables:
- Verify connection field exists
- Confirm connection direction (parent to child)
- Ensure records are properly connected
Step 2: Add Rollup Field
- Open Data Builder
- Select parent table (where rollup will display)
- Click "Add Field"
- Select "Rollup" field type
- Name the field descriptively
Step 3: Configure Rollup Settings
- Select Connection
- Choose which connected table to aggregate from
- Choose Aggregation Function
- SUM, COUNT, AVG, MIN, or MAX
- Select Field to Aggregate (if not COUNT)
- Which field to sum, average, etc.
- Optional: Add Filter
- Count/sum only specific records
- Example: Sum only "Paid" invoices
- Set Display Format
- Number formatting, decimals
- Currency symbol if applicable
Step 4: Test Rollup
- View records with rollup field
- Verify calculations are correct
- Test with different record scenarios
- Confirm updates work when child records change
Rollup Field Examples
Customer Table Rollups:
- "Total Orders"
- COUNT of Orders connection
- Shows how many orders customer has placed
- "Total Revenue"
- SUM of Orders → Order Total
- Total money customer has spent
- "Average Order Value"
- AVG of Orders → Order Total
- Typical order size
- "First Order"
- MIN of Orders → Order Date
- Customer since date
- "Last Order"
- MAX of Orders → Order Date
- Most recent purchase
Project Table Rollups:
- "Total Tasks"
- COUNT of Tasks connection
- "Completed Tasks"
- COUNT of Tasks where Status = "Completed"
- "Total Hours"
- SUM of Tasks → Hours Logged
- "Average Task Duration"
- AVG of Tasks → Duration
Product Table Rollups:
- "Total Units Sold"
- SUM of Order Line Items → Quantity
- "Total Revenue"
- SUM of Order Line Items → Line Total
- "Times Ordered"
- COUNT of Order Line Items
- "Average Order Quantity"
- AVG of Order Line Items → Quantity
Department Table Rollups:
- "Total Employees"
- COUNT of Employees
- "Total Salary Cost"
- SUM of Employees → Salary
- "Average Salary"
- AVG of Employees → Salary
- "Newest Hire Date"
- MAX of Employees → Hire Date
Filtered Rollups
Use Cases
- Count only "Active" records
- Sum only "Paid" invoices
- Average only "Completed" tasks
- Count orders from "This Year"
Configuration
- Create rollup field as normal
- Click "Add Filter"
- Select field to filter on
- Choose operator (equals, greater than, etc.)
- Set filter value
- Multiple filters can be combined
Examples
- "Total Paid"
- SUM of Invoices → Amount
- Filter: Status = "Paid"
- "Total Unpaid"
- SUM of Invoices → Amount
- Filter: Status = "Unpaid"
- "Completed Tasks"
- COUNT of Tasks
- Filter: Status = "Completed"
- "Overdue Tasks"
- COUNT of Tasks
- Filter: Due Date < Today AND Status ≠ "Completed"
- "This Month Revenue"
- SUM of Orders → Total
- Filter: Order Date = "This Month"
- "This Year Revenue"
- SUM of Orders → Total
- Filter: Order Date = "This Year"
Combining Rollups with Equations
Completion Percentage
IF({Total Tasks} > 0, ROUND(({Completed Tasks} / {Total Tasks}) * 100, 0), 0)
Days Since Last Order
TODAY() - {Last Order Date}
Customer Lifetime Value
{Total Revenue} + ({Average Order Value} * {Expected Future Orders})
Inventory Turnover
{Total Units Sold} / {Current Stock}
Employee Utilization
IF({Total Hours Available} > 0, ROUND(({Total Hours Logged} / {Total Hours Available}) * 100, 0), 0)
Multi-Level Rollups
Example: Customer → Orders → Line Items
Scenario: Calculate total quantity of all items ever ordered by customer
Method 1: Two-Step Rollup
- Order Table: "Line Item Total Qty"
- SUM of Line Items → Quantity
- Customer Table: "All Items Quantity"
- SUM of Orders → Line Item Total Qty
Method 2: Direct Multi-Level
Some scenarios allow direct multi-level aggregation through formula combinations.
Rollup Best Practices
Performance
- Rollups can be slow with thousands of records
- Use filters to limit records being aggregated
- Consider scheduled updates for very large datasets
- Index fields used in rollup filters
Naming
- Use clear, descriptive names
- "Total Orders" not "Orders"
- "Average Score" not "Score"
- Indicate the aggregation type in the name
Display
- Format numbers appropriately
- Use currency symbols for money
- Set appropriate decimal places
- Consider using badges or indicators for key metrics
Validation
- Test rollups with sample data
- Verify calculations manually
- Check edge cases (zero records, null values)
- Confirm updates happen in real-time
Documentation
- Document what each rollup calculates
- Note any filters applied
- Explain calculation logic to team
- Maintain rollup field inventory
Common Rollup Patterns
Pattern 1: Order Total from Line Items
- Order table rollup
- SUM of Line Items → Line Total
- Automatically calculates order total
Pattern 2: Customer Lifetime Value
- Customer table rollup
- SUM of Orders → Order Total
- Shows total customer spend
Pattern 3: Project Progress
- Project table rollups
- COUNT of Tasks (total)
- COUNT of Tasks where Status = "Completed"
- Use in equation for percentage
Pattern 4: Inventory Available
- Product table rollups
- COUNT of Warehouse Locations
- SUM of Stock Quantities
- Track inventory across locations
Pattern 5: Employee Workload
- Employee table rollups
- COUNT of Assigned Tasks
- COUNT where Status = "In Progress"
- SUM of Estimated Hours
Pattern 6: Revenue Analytics
- Multiple filtered rollups
- This Month revenue
- Last Month revenue
- Year to date revenue
- Compare periods
Real-World Applications
Sales CRM
- Customer lifetime value
- Total opportunities value
- Win rate calculations
- Average deal size
- Pipeline value by stage
Project Management
- Total project hours
- Completion percentage
- Budget vs actual
- Resource utilization
- Milestone tracking
E-commerce
- Customer order history
- Product sales totals
- Category revenue
- Average cart value
- Repeat purchase rate
Inventory Management
- Stock on hand
- Items sold
- Reorder quantities
- Turnover rates
- Location totals
Education
- Student grade averages
- Course completion rates
- Assignment counts
- Attendance statistics
- Test score analytics
Troubleshooting Rollups
Common Issues:
Rollup Shows Zero or Blank
- Verify connection exists between records
- Check filter settings—may be excluding all records
- Ensure aggregated field has values
- Confirm field types match
Rollup Doesn't Update
- Refresh the page
- Check if child records actually changed
- Verify rollup configuration is correct
- Contact support if persists
Unexpected Values
- Manually verify calculation
- Check for hidden filters
- Review connection field setup
- Confirm aggregation function is correct
Slow Performance
- Too many records being aggregated
- Add filters to reduce scope
- Consider alternative approaches
- Optimize database indexes
Summary
- Rollup functions aggregate data across connected records
- SUM, COUNT, AVG, MIN, MAX provide different aggregation types
- Filtered rollups aggregate only specific records
- Combined with equations for advanced calculations
- Multi-level rollups aggregate across connection chains
- Best practices ensure performance and accuracy
Next: Continue to Action Links and Details to learn how to create interactive record views.
Hands-On Exercise (To Be Added)
Exercise placeholders will include practical activities such as:
- Create customer total revenue rollup
- Build project completion percentage using rollups and equations
- Set up filtered rollups for time period analysis
- Create multi-level rollups across connection chains
- Build a dashboard using multiple rollup fields
Knowledge Check (To Be Added)
Quiz questions will test understanding of:
- Difference between rollup and equation fields
- When to use each aggregation function
- How to configure filtered rollups
- Combining rollups with equations
- Best practices for rollup performance

We'd love to hear your feedback.