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:
  • Days since – the count of the days which have past from the date until now
  • Months since – the count of the months which have past from the date until now
  • Years since – the count of the years past from the date until now
  • Year of – the year of the date
  • Month of – the month of the date
  • Date of – returns only the date part (without time) from the date
  • Weekday of – the weekday number of the date
  • Has anniversary today – returns true if today has the same day and month as the date
  • Days until – the count of the days from today until the future date
  • Months until – the count of the months from today until a future date
  • Years until – the count of the years from today until a future date.
  • Day Of – the day of the date.
  • Days until Anniversary – the count of the days from today until the date.
  • For “since” functions, if the date is a future date, then the return count will be negative.
  • For “until” functions, if the date is a past date, then the return count will be negative.
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