Aggregation Function
Aggregation functions are essential for summarizing data in meaningful ways when creating a measure. These functions operate on a set of values and return a single summarized result.
Supported Aggregation Functions
Recurve supports the following aggregation functions:
1. SUM
SUM
Calculates the total sum of a numeric field.
Example:
Returns the total revenue across all records.
2. COUNT
COUNT
Counts the number of records.
Example:
Returns the total number of orders.
3. COUNT DISTINCT
COUNT DISTINCT
Counts the number of unique values in a field.
Example:
Returns the number of unique customers.
4. AVG
AVG
Computes the average value of a numeric field.
Example:
Returns the average order amount.
5. MIN
MIN
Finds the smallest value in a field.
Example:
Returns the lowest product price.
6. MAX
MAX
Finds the largest value in a field.
Example:
Returns the highest product price.
7. CUSTOM
CUSTOM
Allows users to define their own aggregation logic using formulas.
Example:
Calculates the average revenue per order.
Usage in Measures
When defining a measure, an aggregation function must be specified to determine how the data should be summarized. Below is an example of how an aggregation function is used to define a measure:
This measure calculates the total revenue by summing up all revenue values.
Last updated