Syntax
Properties
The name of the measure.
Examples
Sum of a field
Measure with division
Custom SQL function
👋 Welcome to the new Omni docs! We're still migrating, but the old docs are available at docs-legacy.omni.co.
The core declaration of the field definition.
<measure_name>:
sql: ${<view_name>.<field_name>}
Hide measure_name properties
${} syntax, raw SQL functions, or arithmetic operations.Field type is implicit in Omni, and defined based upon the underlying field’s database type. To change the type, CAST the field (for example, sql: ${zip_code}::string).${view.name}) instead of the raw database name. For example, ${orders.id}total_revenue:
sql: ${orders.sales_price}
aggregate_type: sum
revenue_per_order:
sql: ${orders.total_revenue} / ${orders.count}
average_revenue:
sql: AVG(${orders.sales_price})
Was this page helpful?