Documentation Index
Fetch the complete documentation index at: https://docs.omni.co/llms.txt
Use this file to discover all available pages before exploring further.
Don’t see an aggregate you want? Use SQL to define the aggregate instead, for example: sql: MEDIAN(${orders.price}
Syntax
<measure_name>:
sql: ${<view_name>.<field_name>}
aggregate_type: <aggregation_method>
Properties
The name of the measure.Hide measure_name properties
The SQL used to create the measure. Specify fields as view_name.field_name.
The aggregation method to apply to the measure. Must be one of:| Aggregate type | Description |
|---|
sum | Sum of values |
count | Count of rows |
count_distinct | Count of distinct values |
average | Average of values |
min | Minimum value |
max | Maximum value |
median | Median value |
list | Concatenated list of values |
percentile | Percentile calculation. Requires an additional percentile parameter on the measure. Refer to the Examples section for an example. |
sum_distinct_on | Sum with deduplication on a custom key. Requires custom_primary_key_sql. |
average_distinct_on | Average with deduplication on a custom key |
median_distinct_on | Median with deduplication on a custom key |
percentile_distinct_on | Percentile with deduplication on a custom key |
Examples
total_revenue:
sql: ${orders.sales_price}
aggregate_type: sum
revenue_per_order:
sql: ${orders.total_revenue} / ${orders.count}
perc_75_age:
sql: ${users.age}
aggregate_type: percentile
percentile: 75
sum_distinct_example:
sql: price
aggregate_type: sum_distinct_on
custom_primary_key_sql: ${id}