Define Aggregate Data
In the Define Aggregates Data section, you can define the data to use as token or to add a new condition to filter the dataset. To add aggregate data, next to the Define Aggregates Data section title, click the Add a row icon. An empty row is added in the table. Using inline editing, set the following fields:
Field | Description |
---|---|
Aggregate Type | Select an aggregate function applied over the dataset: SUM, MAX, MIN, COUNT, AVG |
Entity Source | Represents one of the selected entities, the source for the aggregate data. The drop-down list is populated only with the entities selected in the Get all records for entity section. |
Source Attribute | Select one of the entity source attributes. It is used to calculate the aggregate function. |
Date function | If the source attribute is a datetime attribute, you can use a date function to obtain different kind of information starting with the date:
|
Aggregates Levels | Represents one of the query levels used by the function to aggregate. It works like a group by clause. |
Alias | Alias that you can use in aggregates filter. |
You can add segmentation conditions based on aggregated attributes. This is similar to filtering entities’ attributes. You can define aggregated fields only by using the related entities added in the entity conditions definition section.
Example of aggregated fields:
- The total number of active contracts the customer has – use “Count” Function for “Loan Agreement”, aggregated at the customer level. Conditions for the Contract status = Active will be defined in the initial condition definition area at the “Loan Agreements” level.
- The rejected applications at the customer level - use “Count” Function for “Loan Application”, aggregated at the customer level. Conditions for Loan Application Status = Rejected will be defined in the initial condition definition area at the “Loan Applications” level.
Example of a condition added for an aggregated field:
The number of active contracts <= 1 – to select the customers that have at least 1 active contract
Number of Rejected Applications = 0 – to select the customers with no rejected applications