always_filter

Usage

explore: explore_name {  always_filter:{    filters:[field_name:"filter expression",field_name:"filter expression", ...]  }}
Hierarchy
always_filter
Default Value
None

Accepts
A field name and aLooker filter expression

Definition

Thealways_filter parameter lets you require users to include a set of filters for an Explore. After you define the filters and their default values by using thealways_filter parameter, then the Explore automatically displays your configured filter settings.

The filters that you specify in thealways_filter parameter can't be removed from the Explore. However, your users can modify the filter by changing the filter's values or by changing the filter's condition from the condition drop-down menu. Your users can also remove all values from the filter, which has the same effect as removing the filter.

If you want an Explore to have filters that can't be modified or removed, use one of the following parameters instead:

  • To configure filters that are the same for everyone and that can't be seen or changed in any way, you can usesql_always_where.
  • To configure filters that are specific to each user and that can't be seen or changed in any way, you can useaccess_filter.

In thealways_filter parameter, the field that's referenced in thefilters subparameter can be adimension,measure,filter, orparameter. If you need to reference a dimension or measure that is part of a joined view rather than part of this Explore, useview_name.field_name. For example:

explore: order {  always_filter: {    filters: [id: "123", customer.id: "789"]  }  join: customer {    sql_on: ${order.customer_id} = ${customer.id} ;;  }}

Here theid filter refers to theid field fromorder. Thecustomer.id filter refers to theid field fromcustomer. This example also demonstrates that you can add multiple filters.

For eachfield_name: "filter expression" pair, the filter expression can be an absolute value or you can useLooker filter expressions, depending on the type of field that you're filtering on.

Examples

Configure a default filter for the Explore on theOrder ID field (with a default value of "123"):

explore: order {  always_filter: {    filters: [id: "123"]  }}

Configure a default filter for the Explore on theOrder Created Date field (with a default value of the previous seven days):

explore: order {  always_filter: {    filters: [created_date: "7 days"]  }}

Configure a default filter for the Explore on theOrder ID field (default value of "123"), theOrder City field (default value of "Chicago"), and theCustomer Age field (default value of greater than or equal to 18):

explore: order {  always_filter: {    filters: [id: "123", city: "Chicago", customer.age: ">=18"]  }  join: customer {    sql_on: ${order.customer_id} = ${customer.id} ;;  }}

Things to consider

Users can't remove a filter specified byalways_filter

Although users may change the condition or the default value for their query, they can't remove a filter that has been added byalways_filter. If you want to pre-load filters for an Explore in a way that lets users completely remove the filters, consider creating a query that includes suggested filters and thensharing the query with users so they can use the query and its filters as a starting point.

Setting a blank default value

If you want to create a default filter with ablank default value, you can do so by specifying"-EMPTY" in the filter values:

always_filter: {  filters: [products.category: "-EMPTY"]}

Thealways_filter parameter overrides adefault_value filter setting

Thealways_filter parameter overrides thedefault_value setting for the field. If you declare a value withalways_filter, that value will be the default in the Explore. If you don't declare a value withalways_filter, then "is any value" is the filter default in the Explore.

always_filter affects existing Looks and dashboard tiles

Adding thealways_filter parameter to an existingexplore definition adds the set of filters with the default values to any Looks, Explores, or dashboard tiles that are based on thatexplore, including previously saved Looks and dashboard tiles that are based on theexplore.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-19 UTC.