Skip to main content

Limitations

Dimensions and measures can’t be grouped together. Applying the same group label to a dimension and a measure will result in two groups displaying in the field browser, not one group with both fields.

Syntax

<dimension_name>:
  group_label: <label_text>

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
group_label
string
Unquoted text specifying the group under which the field should appear in the field browser. Use the greater-than symbol (>) with whitespace on either side to create nested group hierarchies. Refer to the Organize fields with nested groups guide for more information and examples.

Date dimensions

When you apply a group_label to a date dimension, all timeframe variations (day, week, month, year, etc.) automatically nest under the parent field name within that group. For example:
Parent date field with a group label
created_at:
  group_label: Important Dates
In the field browser, this renders as:
â–¾ Important Dates
  â–¾ Created At
      Created At Date
      Created At Week
      Created At Month
      Created At Year
      ...
This keeps related timeframes organized together while allowing you to categorize date fields into logical groups. If you want to have specific timeframes as standalone dimensions (not under a group), specify timeframes: [].

Examples

Grouping fields
name:
  group_label: Important Fields
Nesting under a timeframe group
created_at: {}

example_new_time:
  sql: "other_time"
  group_label: Created At
  timeframes: [minute]
Standalone date dimensions
created_at_date:
  sql: ${created_at[date]}
  label: Created at Date
  timeframes: []

created_at_month:
  sql: ${created_at[month]}
  label: Created at Month
  timeframes: []
In this example, note that the group_label is "Created At" not "created_at", as the group label must match the label, not the field:
Custom timeframe in existing group
created_at_minute_5:
  sql: id+1
  group_label: Created At

Nested groups

Grouping types of customer data
views:
  customers:
    dimensions:
      first_name:
        group_label: Contact Info > Name
      last_name:
        group_label: Contact Info > Name
      email:
        group_label: Contact Info
      phone:
        group_label: Contact Info
      street:
        group_label: Location > Address
      city:
        group_label: Location > Address
      state:
        group_label: Location > Address
      country:
        group_label: Location
Grouping date fields by category
views:
  orders:
    dimensions:
      created_at:
        group_label: Key Dates
      shipped_at:
        group_label: Key Dates
      internal_timestamp:
        group_label: System > Timestamps