Skip to main content
If absent, Omni uses default timeframes: raw, date, week, month, quarter, year. Timezone handling is possible using the convert_tz argument, done in concert with connection-level timezone settings. Date or time fields can reference parameterized timeframes in the model as follows:
  • timestamp_created_at (the β€˜raw’ reference)
  • timestamp_created_at[date]
  • timestamp_created_at[year]
  • timestamp_created_at[day_of_week_name]
  • timestamp_created_at[month_name]

Syntax

<dimension_name>:
  timeframes: [<timeframe_1>, <timeframe_2>, ...]

Properties

dimension_name
object
The name of the dimension. Dimension names must:
  • Be unique within the view
  • Start with a letter
  • Contain only alphanumeric characters and underscores

Examples

Custom timeframes
created_at:
  sql: created_at
  timeframes: [date, week, day_of_week_name]
  convert_tz: false
Timezone-specific field
timestamp_created_pst:
  sql: DATETIME(${marketing_orders_new.timestamp_created}, 'America/Los_Angeles')
  timeframes:
    - DATE
    - HOUR_OF_DAY
    - MONTH_NAME
Custom timeframes can be included using group_label. The group_label should match the label rather than the underlying field:
Custom timeframe in existing group
created_at_minute_5:
  sql: id+1
  group_label: Created At