Skip to main content

Syntax

query:
  calculations:
    <calculation_name>:
      sql: ${<view_name>.<field_name>} <OMNI SQL TABLE FUNCTION>

Properties

query
object[]
An object containing the individual parameters that make up a query view’s query definition.

Examples

Calculation that adds 2 to users.age
query:
  fields:
    users.age: age
    users.created_at[year]: created_at_year
    age_calc: age_plus_two
  calculations:
    age_calc:
      sql: ${users.age} OMNI_FX_PLUS 2
Calculation with drilling disabled
query:
  fields:
    users.count: count
    orders.count: orders
    calc_ratio: ratio
  calculations:
    calc_ratio:
      sql: ${users.count} OMNI_FX_DIVIDE ${orders.count}
      drill_disabled: true