Usage
dimension: field_name {
suggest_dimension: dimension_name
}
}
Hierarchysuggest_dimension |
Possible Field TypesDimension, Dimension Group, Measure, Filter, ParameterAcceptsA fieldname in the current view or viewname.fieldnameSpecial RulesTo refer to a field in another view, use viewname.fieldname where viewname is a view joined in the Explore |
Definition
This parameter changes how Looker generates suggestions for a filter
field or a dimension
of type: string
when someone uses that field to filter a query.
Looker typically generates these suggestions by executing the following query on the filter field:
SELECT DISTINCT <field name> FROM <table> LIMIT 1000
If the field is in a large table, this query can be too slow or create too large a database load.
By using suggest_dimension
, you can make Looker query an alternative dimension for the suggestion values. If that dimension is defined in a different Explore, suggest_explore
tells Looker where to find it. In this case, include both the view name where the dimension is defined and the dimension name in the format view_name.field_name
. In addition, ensure that the view is joined to the Explore that is specified in the suggest_explore
parameter.
If the dimension is defined in the current view, suggest_explore
is not required.
Examples
In this example, instead of looking through a huge list of user names from the event
table, we’ve told Looker to query the names from a user
table instead:
In this example, rather than a different Explore, the suggestion uses a dimension in another view joined to the same Explore: