Rollup Summary Fields
A Rollup Summary field is a read-only field that calculates and displays the sum, average, minimum, or maximum value of a field in a related list or the record count of all records listed in a related list. Rollup Summary fields provide powerful aggregation capabilities without requiring custom code or formula fields.
Before You Begin
Requirements
To create or configure a Rollup Summary field, users must have the following permissions:
- Administrator System Role
Understanding Rollup Summary Fields
Rollup Summary fields allow you to automatically calculate values from child records in a Master-Detail relationship. Common use cases include:
- Calculating the total amount of all Order Line Items on an Order
- Counting the number of Cases associated with an Account
- Finding the earliest due date among all Tasks related to a Project
- Calculating the average rating across all Product Reviews
Key Characteristics
- Read-only: Rollup Summary fields cannot be edited directly; they are automatically calculated
- Automatic updates: Values update automatically when child records are created, modified, or deleted
- Master-Detail requirement: Can only be created on the parent entity in a Master-Detail relationship
- Multiple rollups allowed: You can create multiple Rollup Summary fields on the same parent entity
Creating or Configuring a Rollup Summary Field
To create or configure a rollup summary field:
In the Setup Home page, click Create > Entities.
Click the Entity in which you want to add a Rollup Summary field. This must be the parent entity in a Master-Detail relationship.
Select the Fields tab.
To create a new Rollup Summary field:
- Click New
- Select Rollup Summary
- Click Next Step
To configure an existing Rollup Summary field:
- Select the field
- Click Edit
Configure the following fields:
Label: Enter a label for the Rollup Summary field (e.g., "Total Amount", "Number of Line Items").
Name: This field will be automatically populated based on the Label. The Name is used when referencing the field via the API.
In the Related To dropdown box, select the Entity in which the displayed field is located (the child entity in the Master-Detail relationship).
In the Relationship Field dropdown box, select the Master-Detail field that creates the parent-child relationship. This determines which child records are included in the rollup calculation.
Select the desired Rollup type:
- Count: Counts the number of related child records
- Sum: Adds up the values from a numeric field on child records
- Min: Finds the minimum value from a field on child records
- Max: Finds the maximum value from a field on child records
- Avg: Calculates the average value from a numeric field on child records
If you have selected Sum, Avg, Min, or Max as your Rollup type:
- In the Field To Aggregate dropdown menu, select the field on the child entity that the rollup will calculate
- Only numeric, currency, date, and datetime fields appear in this dropdown
Configure the Rollup filter criteria (optional):
- Add filters to include only specific child records in the calculation
- All filters are automatically combined with AND logic (all conditions must be true)
- Example: Only include Line Items where Status = "Approved" AND Amount > 0
If you want to provide an icon offering information on hover, enter a help message in the Inline Help text field.
If you want to provide a description of the field, enter a description in the Description text field.
Click Save.
The Rollup Summary field is now created and will automatically calculate based on the child records that meet the filter criteria.
Rollup Types Explained
Count
Counts the number of related child records.
Use Cases:
- Number of Opportunities per Account
- Count of Tasks per Project
- Number of Line Items on an Order
Configuration:
- No Field To Aggregate required
- Only filter criteria affects the count
Example:
Field: Number of Open Cases
Rollup Type: Count
Related To: Case
Filter: Status != "Closed"
Result: Counts all non-closed cases
Sum
Adds up the values from a numeric field on child records.
Use Cases:
- Total Order Amount from Line Items
- Total Hours Logged on Project Tasks
- Sum of Invoice Amounts per Account
Configuration:
- Requires Field To Aggregate (numeric or currency field)
- Common for currency and number fields
Example:
Field: Total Order Value
Rollup Type: Sum
Related To: Order Line Item
Field To Aggregate: Amount
Result: Sums all line item amounts
Min (Minimum)
Finds the minimum (lowest) value from a field on child records.
Use Cases:
- Earliest Start Date among Tasks
- Lowest Price among Product Offerings
- Minimum Quantity in Stock Items
Configuration:
- Requires Field To Aggregate (numeric, currency, date, or datetime field)
- Returns the smallest value found
Example:
Field: Next Due Date
Rollup Type: Min
Related To: Task
Field To Aggregate: Due Date
Result: Shows the earliest due date
Max (Maximum)
Finds the maximum (highest) value from a field on child records.
Use Cases:
- Latest Activity Date among Cases
- Highest Amount among Invoices
- Maximum Temperature Reading
Configuration:
- Requires Field To Aggregate (numeric, currency, date, or datetime field)
- Returns the largest value found
Example:
Field: Last Contact Date
Rollup Type: Max
Related To: Activity
Field To Aggregate: Activity Date
Result: Shows the most recent activity
Avg (Average)
Calculates the average (mean) value from a numeric field on child records.
Use Cases:
- Average Deal Size
- Average Response Time
- Mean Customer Rating
Configuration:
- Requires Field To Aggregate (numeric or currency field)
- Divides the sum by the count of records
Example:
Field: Average Order Value
Rollup Type: Avg
Related To: Order Line Item
Field To Aggregate: Amount
Result: Average line item amount
Using Rollup Filter Criteria
Rollup filter criteria allow you to include only specific child records in the calculation. Multiple filters are automatically combined using AND logic, meaning all filter conditions must be met for a child record to be included in the rollup calculation.
Common Filter Scenarios
Include only approved records:
Field: Status
Operator: equals
Value: Approved
Exclude cancelled items:
Field: Status
Operator: not equals to
Value: Cancelled
Include only high priority:
Field: Priority
Operator: equals
Value: High
Date range filter (multiple conditions with AND):
Filter 1:
Field: Created Date
Operator: greater or equal
Value: 2025-01-01
Filter 2:
Field: Created Date
Operator: less than
Value: 2026-01-01
Result: Only includes records created in 2025 (both conditions must be true)
Multiple conditions (all must be true):
Filter 1: Status not equals to "Cancelled"
Filter 2: Amount greater than 0
Filter 3: Approved checkbox equals True
Result: Only includes records where status is not cancelled AND amount is greater than zero AND approved is checked
Important: Unlike validation rules and sharing filters, rollup summary filters do not support complex filter logic with OR conditions or parenthetical grouping. All filters are combined with AND logic only.
Practical Examples
Example 1: Total Opportunity Amount per Account
Scenario: Calculate the total value of all opportunities for each account.
Configuration:
- Parent Entity: Account
- Field Label: Total Opportunity Value
- Related To: Opportunity
- Relationship Field: Account (Master-Detail field on Opportunity)
- Rollup Type: Sum
- Field To Aggregate: Amount
- Filter Criteria: None (include all opportunities)
Result: Each Account shows the sum of all Opportunity amounts.
Example 2: Count of Open Cases per Account
Scenario: Count how many open cases each account has.
Configuration:
- Parent Entity: Account
- Field Label: Open Case Count
- Related To: Case
- Relationship Field: Account (Master-Detail field on Case)
- Rollup Type: Count
- Field To Aggregate: N/A
- Filter Criteria: Status != "Closed"
Result: Each Account shows the count of cases where status is not closed.
Example 3: Average Order Line Item Price
Scenario: Calculate the average price of line items on an order.
Configuration:
- Parent Entity: Order
- Field Label: Average Item Price
- Related To: Order Line Item
- Relationship Field: Order (Master-Detail field on Line Item)
- Rollup Type: Avg
- Field To Aggregate: Unit Price
- Filter Criteria: Quantity > 0
Result: Each Order shows the average unit price of line items with quantity greater than zero.
Example 4: Next Task Due Date
Scenario: Show the earliest due date among incomplete tasks on a project.
Configuration:
- Parent Entity: Project
- Field Label: Next Task Due
- Related To: Task
- Relationship Field: Project (Master-Detail field on Task)
- Rollup Type: Min
- Field To Aggregate: Due Date
- Filter Criteria: Status != "Completed"
Result: Each Project shows the earliest due date among incomplete tasks.
Example 5: Last Activity Date
Scenario: Track the most recent activity date for each account.
Configuration:
- Parent Entity: Account
- Field Label: Last Activity
- Related To: Activity
- Relationship Field: Account (Master-Detail field on Activity)
- Rollup Type: Max
- Field To Aggregate: Activity Date
- Filter Criteria: None
Result: Each Account shows the date of the most recent activity.
Best Practices and Recommendations
- Plan Master-Detail relationships carefully: Rollup Summary fields require Master-Detail relationships. Plan these relationships before creating rollup fields.
- Use meaningful field labels: Choose descriptive names that clearly indicate what is being calculated (e.g., "Total Invoice Amount" instead of just "Total").
- Apply filters strategically: Use filters to exclude irrelevant records and ensure accurate calculations (e.g., exclude cancelled or deleted records).
- Consider performance: Rollup Summary fields recalculate when child records change. Entities with many child records may experience slight delays during updates.
- Combine with validation rules: Use rollup values in validation rules to enforce business logic (e.g., "Order total cannot exceed credit limit").
- Display on page layouts: Add Rollup Summary fields to page layouts so users can see the calculated values.
- Use in formulas: Reference Rollup Summary fields in formula fields for additional calculations.
- Document business logic: Add descriptions to rollup fields explaining what they calculate and any filter criteria applied.
- Test with various scenarios: Test rollups with zero child records, one child record, and many child records to ensure correct behavior.
- Monitor blank values: Understand that rollups return blank (null) when no child records meet the criteria.
Troubleshooting Tips
Issue: Cannot create Rollup Summary field on entity.
Solution: Rollup Summary fields can only be created on the parent entity in a Master-Detail relationship. Verify that the entity has at least one child entity with a Master-Detail field pointing to it.
Issue: Rollup Summary field shows blank value.
Solution: This occurs when no child records exist or no child records meet the filter criteria. Verify that child records exist and check your filter criteria.
Issue: Rollup Summary field not updating after child record changes.
Solution: Rollup fields update automatically but may take a moment to recalculate. If the value doesn't update, verify that the child record is saved and that it meets the filter criteria.
Issue: Cannot select desired field in Field To Aggregate dropdown.
Solution: The Field To Aggregate dropdown only shows numeric, currency, date, and datetime fields. Text and other field types cannot be aggregated. Verify the field type on the child entity.
Issue: Rollup showing incorrect value.
Solution: Check the filter criteria to ensure only intended records are included. Review the Relationship Field to ensure it's pointing to the correct Master-Detail field.
Issue: Cannot create Master-Detail relationship for rollup.
Solution: Master-Detail fields can only be created between native Magentrix entities. You cannot create Master-Detail relationships where the parent is a Salesforce or Dynamics object. Use Lookup fields instead.
Issue: Rollup Summary field causing performance issues.
Solution: If the parent entity has thousands of child records, recalculation may be slow. Consider using filter criteria to limit the number of records included in the calculation, or evaluate if a scheduled batch calculation would be more appropriate.
Issue: Average (Avg) returning unexpected decimal value.
Solution: Average calculations divide the sum by the count. Set appropriate decimal places on the Rollup Summary field to control display precision.
Issue: Min or Max rollup with dates showing unexpected value.
Solution: Ensure that child records have valid date values. Blank dates are not included in Min/Max calculations. If all child records have blank dates, the rollup will be blank.
See Also
Jump to Magentrix Entity Checklist
<< Configuring Magentrix Entity Formula Fields | Master Detail Fields and Lookup Fields >>