Skip to main content
If a measure has drill_queries and drill_fields defined, drill_queries will override drill_fields.
Drill queries appear as options when you click to drill on a measure in a document. Providing drill queries is more flexible than a drill_fields set, as they allow you to specify the underlying query to drill. This includes changes such as limits, sorts, filters, and base views. Filters specified in a drill query are additive, meaning they will be applied in addition to any filters from the main query and the associated dimension values of the cell being drilled. If you want to reference fields from multiple views, ensure that a relationship exists between your base view and the other referenced views so that your drill down will render as expected. To get the structure + syntax of a query, build a query in a workbook and open up the inspector and scroll down to the “Query Structure” settings.

Syntax

<measure_name>:
  drill_queries:
    <Drill Query Label>:
      fields: [<field1>, <field2>, ...]
      base_view: <view_name>
      filters: {...}
      sorts: [...]
      limit: <number>

Properties

measure_name
object[]
The name of the measure.

Examples

Multiple drill options
my_fun_measure:
  sql: ${field_we_aggregate}
  aggregate_type: sum
  drill_queries:
    First Drill for Top 10:
      fields:
        [
        field_1,
        field_2
        ]
      base_view: view_name_1
      filters:
        is_top_10:
          is: true
      sorts:
        - field: view_name_1.field_1
        - field: view_name_1.field_2
          desc: true
    Customer Details:
      fields:
        [
        customer_name,
        customer_email,
        registration_date
        ]
      base_view: customers
      limit: 20
      sorts:
        - field: customers.registration_date
          desc: true