filters: [field_name: "filter expression", field_name: "filter expression", …]
AcceptsA field name and a Looker filter expression
always_filter enables you to require users to include a certain set of filters that you define. You also define a default value for the filters. Though users may change your default value for their query, they cannot remove the filter entirely.
The field referenced in the
filters subparameter can be a dimension, measure, filter, or parameter. If you need to reference a dimension or measure that is part of a joined view rather than part of this Explore, use
view_name.field_name. For example:
id filter refers to the
id field from
customer.id filter refers to the
id field from
customer. This example also demonstrates that you can require multiple filters.
value subparameter, specify default values using Looker filter expressions.
Force the user to use an Order ID filter (with a default value of “123”):
Force the user to use an Order Created Date filter (with a default value of the previous seven days):
Force the user to use an Order ID filter (default value of “123”), an Order City filter (default value of “Chicago”), and a Customer Age filter (default value of greater than or equal to 18):
Users can’t remove a filter specified by
The Explore UI does not let users remove a filter that has been added by
always_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 then sharing the query with users so they can use the query and its filters as a starting point.
always_filter parameter overrides a
default_value filter setting
always_filter overrides the
default_value setting for the field. If you declare a value with
always_filter, that value will be the default in the Explore. If you do not declare a value with
always_filter, then “is any value” is the filter default in the Explore.
Things to know
always_filter affects existing Looks and dashboard tiles
always_filter to an existing
explore definition adds the set of filters with the default values to any Looks, Explores, or dashboard tiles based on that
explore, including previously saved Looks and dashboard tiles that are based on the
If you want filters that users can’t change, consider
If you want an Explore to have filters that are the same for everyone and that cannot be changed in any way, you can use
If you want user-specific filters that users can’t change, consider
If you want an Explore to have filters that are specific to each user and that cannot be changed in any way, you can use