always_filter is a child of
|field_name: 'default value'|
the name of an existing field,
followed by a colon,
followed by 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.
Here the id filter refers to the id field from order. The customer.id filter refers to the id field from customer. This example also demonstrates that multiple filters are allowed.
The default values that you specify accept these types of expressions.
Force the user to use an Order ID filter (with a default value of “123” that they can change):
Force the user to use an Order ID filter (with a default value of “123” or “234” that they can change):
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 “18”):
A User Cannot Remove A Filter Specified By
The Explore UI does not allow a user to remove a filter that has been added by
always_filter. If you do have a desire to pre-load filters with an explore, in such a way that users can completely remove them, consider saving a query with the suggested filters, and having users start with that saved query.
always_filter Overrides a
Default_Value Filter Setting
If an explore specifies a value for this field in an
always_filter parameter, then that setting overrides the
default_value setting for the field.
Things to Know
If You Want Filters That A User Cannot Change Consider
If you want an explore to have filters that are the same for everyone, and cannot be changed in any way, you can use
If You Want User-Specific Filters That Can’t Be Changed Consider
If you want an explore to have filters that are specific to each user, and cannot be changed in any way, you can use