Fields

Guidelines for different types of fields, their naming, attributes, and style

Order of parameters

  • hidden: yes|no

  • UI-related descriptive parameters

    • label

    • group_label

    • group_item_label

    • description

  • type

  • type-related parameters

    • timeframes

    • intervals

    • tiers

  • sql

  • sql-related parameters

    • sql_distinct_key

    • sql_start

    • sql_end

    • sql_latitude

    • sql_longitude

  • value_format_name | value_format

One field as both Dimension and Measure

Measure is an aggregation, whereas Dimension is categorical data. Sometimes, we need the same column, especially if it has numerical value, to be available as both types.

In this case you can create a dimension and use it in the measure using the naming convention

dimension: revenue {
  type: number
  sql: ${TABLE}.revenue ;;
}

measure: total_revenue {
  type:sum
  sql: ${revenue_dim} ;;
}

Last updated