Aggregated Fields
Calculate a value from multiple records in a related model.
Last updated
Calculate a value from multiple records in a related model.
Aggregated fields calculate a single value from multiple records in a related model.
Use them when a record in your parent model is linked to several records in another model. For example, a customer can be linked to many transactions, so you can calculate total revenue, number of purchases, or average basket value.
Choose the parent model where the field will be created.
Select the related model that contains the records to aggregate.
Select an aggregation method.
Choose the field to aggregate when the method requires one.
Optionally add filters to include only relevant records.

Count
Counts related records.
Number of purchases per customer.
Distinct count
Counts unique values.
Number of distinct product categories purchased.
Sum
Adds numeric values.
Total revenue per customer.
Average
Calculates the mean of numeric values.
Average basket value.
Minimum
Returns the lowest value.
Lowest transaction amount.
Maximum
Returns the highest value.
Highest transaction amount.
Most frequent
Returns the most common value.
Most purchased product category.
List aggregation
Returns a list of values.
List of product IDs purchased by a customer.
Use filters to limit the records included in the calculation.
For example, you can calculate:
Revenue from completed transactions only.
Number of purchases in the last 30 days.
Average basket value for a specific product category.
Filters are applied before the aggregation is calculated.
To create a lifetime_value field on a Customers model:
Select Customers as the parent model.
Select Transactions as the related model.
Choose Sum.
Select the transaction amount field.
Filter transactions to include completed purchases only.
The resulting field can then be used in segments and activation mappings.
Last updated

