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.
type: time
dimension groups have also automatically grouped together within each view for quite a while:
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:
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:
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 samegroup_label
there will still be one group under dimensions, and one group under measures.