home User Guide Getting Started Help Center Documentation Community Training Certification
Looker keyboard_arrow_down
language keyboard_arrow_down
Looker documentation will be moving to cloud.google.com in mid-2022!
All the information you rely on will be migrated and all docs.looker.com URLs will be redirected to the appropriate page.
drill_fields (for fields)

This page refers to the drill_fields parameter that is part of a dimension or measure.

drill_fields can also be used as part of a view, as described on the drill_fields (for views) parameter documentation page.


view: view_name {
  dimension: field_name {
    drill_fields: [field_or_set, field_or_set, ]
Possible Field Types
Dimension, Dimension within a Dimension Group, Measure

A square-bracketed list of field names or set names


The drill_fields parameter controls what happens when a user clicks on the value of a table cell while exploring data. When a user does this they “drill” into the data, allowing them to see the individual records that make up that cell, limit their query to the cell’s value, or slice the data in a related way.

The drill_fields parameter accepts a list of fields, sets, or a combination of both fields and sets.

If a measure uses the drill_fields parameter, any drill fields set at the view level will not be applied to that measure.

Drilling can be disabled in some cases:

Once users click a drill field, they are taken into a drill overlay. The data in the overlay has a default sort based on the following prioritization:

  1. The first date dimension, descending
  2. If no date dimension exists, the first measure, descending
  3. If no measure exists, the first added dimension, ascending

Drilling into dimensions

When you drill into a dimension, you have several options:

1. Limit the query to the dimension value the user clicked.

In this case, when a user clicks on a dimension value, they can choose to filter on it:

This option is a default behavior for dimensions and doesn’t require the use of drill_fields.

2. Limit the query to the dimension value the user clicked, and replace the dimension with another.

Another option is to limit the query to a particular value, and replace the dimension with a different, related dimension. For example, you have a country field, and want to drill into it by state. The LookML would look like this:

dimension: country { sql: ${TABLE}.country ;; drill_fields: [state] }

In the Looker UI, this option will appear as:

In this example, if the user chooses to drill by state, the query is limited to the USA (because that is the value they clicked on), the Country dimension is replaced by State, and the pre-drill measures are carried over into the new query:

Dimension groups of type: time have drill fields added to them by default. Each timeframe can drill to the more granular timeframes (e.g. week can drill to date and time, but not month). However, you can limit the timeframes that can be drilled to by using the drill_fields parameter:

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

Drilling into measures

Drilling into a measure shows the row-level data about the items that comprise that measure. While drill_fields can be used on any measure type, it generally makes more sense if used with a count or count_distinct measure. The information that displays for each row is defined by the fields or sets that you define in drill_fields.

For example, suppose you have the following LookML:

measure: count { type: count drill_fields: [user_details*] } set: user_details { fields: [id, name, city, state, country] }

This results in the following user experience: