Grouping Fields Within Views (3.44+)

Some users have wanted greater control over how fields are grouped in Looker’s field picker. Looker 3.44 adds the new group_label parameter to let you group fields together, even within the same view.

Existing Things You Could Already Do

Since 3.20 it’s been possible to adjust the first level of grouping (aka you can adjust the views) by using the view_label parameter.

6dbce5bd83d2c18dde4767a2109fd64fbda39362.png

type: time dimension groups have also automatically grouped together within each view for quite a while:

453d0d2e12dca16e5b2dd863085f97928a5feb9f.png

New Things You Can Do in 3.44

As of 3.44, you can control how the fields are grouped within each view by using the new group_label parameter. For example, you could create a group of shipping fields that would look like this:

4ab5ac1d29fba447efa55d07b51d08759d5c98b7.png

You would achieve this with the following LookML:

dimension: shipping_city {
  sql: ${TABLE}.shipping_city ;;
  group_label: "Shipping Info"
}

dimension: shipping_state {
  sql: ${TABLE}.shipping_state ;;
  group_label: "Shipping Info"
}

dimension: shipping_street {
  sql: ${TABLE}.shipping_street ;;
  group_label: "Shipping Info"
}

group_label also interacts with dimension groups in pretty handy ways. For example, this LookML will add a special date calculation into the existing dimension group:

dimension_group: created {
  type: time
  timeframes: [date, week, month]
  sql: ${TABLE}.created_date ;;
}

dimension: special_date_calculation {
  sql: my_fancy_pants_sql ;;
  group_label: "Created Date"
}

It would look like:

01f26e5283216633112fe343ca5fd89ac75f4e8c.png

Please keep in mind that there must be at least two fields in a group label for it to appear. Also, you can’t group dimensions and measures together in the same group_label. Even if you give a dimension and measure exactly the same group_label there will still be one group under dimensions, and one group under measures.

7 36 7,241
36 REPLIES 36
Top Labels in this Space
Top Solution Authors