User Guide Getting Started Help Center Documentation Community Training
New LookML
Old LookML
New LookML
Looker
  
English
Français
Deutsch
日本語
drill_fields

Usage

view: view_name {
  dimension: field_name {
    drill_fields: [field_or_set, field_or_set, ]
  }
}

Hierarchy

drill_fields

Possible Field Types

Dimension, Dimension Group, Measure

Accepts

A square-bracketed list of field names or set names

Definition

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.

Please note that drilling can be disabled in some cases when the can_filter parameter is used.

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, as shown in this example:

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 may have a country field, and want to be able 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. Consequently, 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 is displayed 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 will result in the following user experience:

Top