Skip to main content
This parameter will explicitly pass only the enumerated field to the query view. If you want to pass any filters used in the UI into the query view, use bind_all_filters.

Limitations

Only supported for query views based on modeled workbook queries. If defining a SQL-based query view using the sql parameter, use a parameterized WHERE clause to achieve the same results.

Syntax

query:
  filters:
    <filter_field>:
      bind: <other_view_name>.<other_field_name>

Properties

query
object[]
An object containing the individual parameters that make up a query view’s query definition.

Examples

Bind order_items.created_at to users.created_at
query:
  fields:
    users.id: id
    order_items.sale_price_sum: sale_price_sum
  base_view: order_items
  filters:
    users.created_at:
      bind: order_items.created_at
  sorts:
    - field: order_items.sale_price_sum
      desc: true
  topic: order_items

In this example, bind is used to push a filter down onto a view that is being re-aggregated over. This enables putting filters on the reaggregate via the filter field while mapping to the underlying query rather than the query view.
Push filter down onto re-aggregated view
query:
  fields:
    order_items.user_id: user_id
    order_items.count: dim_count
  base_view: order_items
  filters:
    users.created_at:
      bind: orders_by_user.created_at
  sorts:
    - field: order_items.count
      desc: true
  topic: order_items
dimensions:
  dim_count: {}
  user_id:
    primary_key: true
measures:
  count:
    aggregate_type: count
filters:
  created_at:
    type: timestamp