drill_fields

LookML
Version

On this Page
Docs Menu

Go to Field Parameter List

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 clicked.

To do this, users click on a dimension value and choose to filter on it, as shown in this example:

This functionality always happens by default, and doesn’t require the use of drill_fields.

2. Limit the query to the dimension value you 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 for this would appear like:

- 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 will be limited to the USA (because that is the value they clicked on), and the Country dimension will be replaced by State:

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*]   sets: user_details: - id - name - city - state - country

This will result in the following user experience:

Still have questions?
Go to Discourse - or - Email Support
Top