Rollup field business scenarios
Let’s take a look at three common rollup field scenarios in more detail. In the first example, we’ll aggregate data for a record from the related records, without using a hierarchy. In two other examples, we’ll aggregate data over a hierarchy. In each example, we define the rollup field by using the Field Editor. To open the Field Editor, go to Settings > Customization > Customize data > Components > Entities. Select the entity you want and click Fields. Click New. In the editor, provide the required information for the field, including the Field Type and Data Type. In the Field Type, select Rollup, after you have selected the data type. The data types include decimal or whole numbers, currency, and date/time. Click the Edit button next to the Field Type. This takes you to the rollup field definition editor. The rollup field definition consists of three sections: Source entity, Related entity and Aggregation.
- In the Source entity section, you specify the entity for which the rollup field is defined and whether or not you aggregate over a hierarchy. You can add filters with multiple conditions to specify the records in the hierarchy you want to use for rollup.
- In the Related entity section, you specify the entity over which you aggregate. This section is optional when you choose to rollup over the hierarchy on the source entity. You can add filters with multiple conditions to specify which related records to use in the calculation. For example, you include the revenue from the open opportunities with an annual revenue greater than $1000.
- In the Aggregate section, you specify the metric you want to compute. You can choose available aggregate functions, such as SUM, COUNT, MIN, or MAX.
Aggregate data for a record from the related records
In this example, a hierarchy is not used. The total estimated revenue is calculated for an account, from the related open opportunities. The screenshot below shows the complete definition for the rollup field.
Aggregate data for a record from the child records, over the hierarchy
In this example, we calculate the total estimated revenue of an opportunity including the child opportunities, over the hierarchy. The screenshot below shows the complete definition for the rollup field.
Aggregate data for a record from the related records, over the hierarchy
In this example, we calculate the total estimated revenue of open opportunities across all accounts, over the hierarchy. The screenshot below shows the complete definition for the rollup field.
Rollup field considerations
You should be aware of certain conditions and restrictions when working with rollup fields:
- You can define a maximum of 100 rollup fields for the organization and up to 10 rollup fields per entity.
- A workflow can’t be triggered by the rollup field updates.
- A workflow wait condition cannot use a rollup field.
- A rollup over the rollup field is not supported.
- A rollup can’t reference a “complex” calculated field that uses the fields of the related entities in the formula. A rollup can reference a “non-complex” calculated field that only uses the fields of the current entity in the formula.
- The rollup can only apply filters to the source entity or related entities, simple fields or non-complex calculated fields.
- A rollup can be done only over related entities with the 1:N relationship. A rollup can’t be done over the N:N relationships.
- A rollup can’t be done over the 1:N relationship for the Activity entity or the Activity Party entity.
- The business rules, workflows or calculated fields always use the last calculated value of the rollup field.
- A rollup field is aggregated under the system user context. All users are able to see the same rollup field value. You can control the rollup field visibility with the field level security (FLS), by restricting who can access the rollup field.
Disclaimer: this text is part of the “Administering CRM 2015 for online and on-premises”-Guide, I have not written this myself and do not claim any ownership of it. Moreover this document is provided “as-is”.
Significant investments have been made in Microsoft Dynamics CRM 2015 – power users don’t need to learn to write code to build insights with the data in their CRM Systems. In this short video Brandon Simons shows you how rollup fields and calculated fields can now be created and configured using a simple interface.