Published at: 2025-10-30
Statistical Fields
I. Use Cases
In many business scenarios, it’s necessary to aggregate field values from Sub-objects or lookup-related objects, with the results displayed as field values in the current object. For example, the total amount of a Sales Order is the sum of all line item amounts.
II. Configuration Guide
1.1 Field Description
You can create aggregate fields in the Primary Object of a master-detail relationship to perform calculations on Sub-objects or related objects and their fields.
1.2 Target Aggregate Object
You can select either Sub-objects or lookup-related objects.
1.3 Aggregate Types
- COUNT: Counts the number of records (e.g., the number of Contacts under an Account).
- SUM: Calculates the total of a field (e.g., the sum of product amounts in a Sales Order).
- MAX: Finds the maximum value of a field (e.g., the highest Opportunity amount under an Account).
- MIN: Finds the minimum value of a field (e.g., the lowest sales expense under an Account).
- AVG: Calculates the average value of a field (e.g., the average discount for order products).
1.4 Field Aggregation
If the target aggregate object contains fields that support the selected aggregate type, you can configure field aggregation by selecting the appropriate fields.
1.5 Rounding Rules
- Round Up: Increments the last decimal place by 1 (e.g., 2.124 → 2.13 when rounded to 2 decimal places).
- Round Down: Truncates the remaining decimal places (e.g., 2.124 → 2.12 when rounded to 2 decimal places).
1.6 Filter Conditions
- Fields referenced in filter conditions cannot be disabled.
- Modifying filter conditions triggers a full recalculation of all data. Avoid frequent changes to filter conditions.
1.6.1 Filter Condition Fields
Supported Field Types for Filtering
Text, numeric, single/multi-select, boolean, user/user multi-select, Dept./Dept. multi-select, lookup relationships, country/region/city, and location fields.
Unsupported Field Types for Filtering
- Formula fields: Regardless of whether they are filterable.
- Aggregate fields
- Reference fields: Regardless of whether they are filterable.
- Component fields: Payment, check-in, region location, and date range components must use their internal fields for filtering.
- Business fields: Star ratings, Videos, and appointment time slots.
- Other unsupported fields: Multi-select lookup relationships, rich text, collaborative rich text, long text, Images, attachments, external users, related business data, and related business objects.
1.7 Notes
- If certain fields in the aggregate field are restricted by Role permissions, the aggregate field will not be calculated or will display as empty.
- Aggregate calculations for lookup-related objects are asynchronous and may experience delays.
- When saving the field configuration, a prompt appears if the dataset exceeds 100,000 records:
- “Do not calculate existing data”: Skips historical data created before the aggregate field was added.
- “Calculate all (may take longer for large datasets)”: Processes all existing data, potentially causing delays (values may temporarily appear empty).
- “Calculate only data matching the following conditions”: Filters data for targeted calculations.
- For datasets ≤100,000 records, the system saves the aggregate field without prompting.
1.8 Viewing Aggregate Task Progress
After creating or editing an aggregate field, a progress tracker is available for large historical data calculations. Click “View Calculation Task Status” to see the total records, completed records, and estimated completion time.
picture coming soon:
Aggregate Field Configuration Rules
II. Aggregate Field FAQs & Troubleshooting
2.1 Why is an aggregate field empty or incorrect?
2.1.1 Example Scenario
picture coming soon:
The “Order Amount (Original Currency)” field aggregates the sum of “Price” from Sub-object “Order Products.”
picture coming soon:
The field appears empty in the list view.
2.1.2 Possible Causes & Solutions
2.1.2.1 Calculation Delay
- For newly created or edited aggregate fields, historical data recalculation may take hours or days for large datasets.
- Bulk imports or batch updates also cause incremental calculation delays.
2.1.2.2 Configuration Errors
- Incorrect target object: Verify the “Target Aggregate Object” (applies only to lookup-related objects).
- Incorrect aggregated field: Ensure the selected field contains data.
- Incorrect filters: Review filter conditions for accuracy.
picture coming soon:
Method 1: Filter data in the target object to identify the lookup relationship.
picture coming soon:
Method 2: Check the related list in the target object’s detail page.
picture coming soon:
Method 3: Verify filter conditions for the aggregated data.
2.1.2.3 Override by Functions
If workflows, UI functions, or post-action scripts modify the aggregate field, use incremental batch updates:
Fx.object.batchUpdate(<String apiName>,<Map objects>)
Fx.object.batchUpdate(<String apiName>,<Map objects>,<List fields>)
Specify the fields parameter to limit updates.
2.1.2.4 Misconfigured Lookup Relationships
- Example: Counting Sales Records under an Account requires using the correct lookup field, not the “Related Business Data” field.
- For counting a user’s Accounts, use the Account’s lookup user field, not the “Owner” field.
2.2 How to Aggregate Other Field Values?
Select the target object and aggregate type. If supported fields exist, choose them under “Field Aggregation.”
2.3 Aggregate Field Timeliness
2.3.1 Real-Time Updates?
No. Calculations run asynchronously in queues. Tenants with dedicated databases have isolated queues.
2.3.2 Bulk Data Updates
Delays occur for:
1. New/edited aggregate fields recalculating historical data.
2. Bulk imports or batch updates.
2.3.3 Single Record Updates
Calculations begin after the target record is saved (created/edited).
2.3.4 Last Modified Time
Changes to aggregate, reference, or formula fields do not update the “Last Modified” timestamp unless other fields change.
Other Issues
Aggregate vs. List Summary Mismatches
- List summaries: Round individual values first, then sum (e.g., 7580.94679 → 7580.95).
- Aggregate fields: Sum raw values first, then round (e.g., 7580.94679 + 3925.088338 → 141699.940000 → 141699.94).
Example:
- List: 7580.95 + 3925.09 + … = 141699.95
- Aggregate: 141699.940000 → 141699.94
Decimal Places
- Functions can write values exceeding configured decimal places. Format values before writing.
- Web displays configured decimals; mobile blocks excess decimals.
Excel Sum vs. Aggregate Field
Exporting list data and summing in Excel may differ due to rounding order. Adjust decimal places in Excel for alignment.