An aggregate block summarizes a property or block by applying an aggregation function to the input property and potentially organizing the results into groups.
Use the following fields to configure the block:
- Aggregator – Choose a function to aggregate input for a block.
- avg – Compute the average of the input values.
- count – Count the total number of input values, including duplicates.
- unique count – Count the number of unique input values.
- first – Compute the first input value, determined by ordering inputs by event time.
- last – Compute the last input value, determined by ordering inputs by event time.
- max – Compute the maximum input value.
- min – Compute the minimum input value.
- sum – Sum input values.
- Input – Provide input for the aggregator block. It can be a property, block, value, or parameter.
- Group by – (Optional) Group the output of the aggregator block by specified attributes. Each attribute can be a property or a block.
Example
To calculate the number of user IDs,
- Select count as the aggregator.
- Select id from the Users dataset.
- Click Apply.
- Click Run.
Output
The aggregate block produces a numerical value. If you use the Group by option, the output may include a grouping attribute.
You can use the aggregate block to calculate the average revenue per user.
- Click + > Metric > Aggregate.
- Calculate the total ad revenue per user in the first aggregate block. Select sum as the aggregator and the Incremental Campaign Revenue derived column as the value.
- Click + > Users in the Group by Property section. Name this block Ad revenue per user.
- Add another aggregate block to calculate the Average revenue per user. Select avg as the aggregator and the previously created Ad revenue per user block as the value.
- Click Run.
Please sign in to leave a comment.