required_fields

LookML
Version

On this Page
Docs Menu

Go to Field Parameter List

Definition

The required_fields parameter allows you to pull additional fields into a query when a user chooses a specific field. In this example, when the user chooses linked_name, the url field is also pulled into the query:

- dimension: linked_name sql: ${name} html: | <a href="{{ row['websites.url'] }}" target="_new"></a> required_fields: [url]

However, please keep in mind that although the required fields are added to the query, they are not displayed to the user. Therefore, if the required fields change the aggregation of the query it can be confusing for the user.

For example, the LookML above will probably work okay, because there will likely be the same number of unique website names and website URLs. However, if the data happened to list several URLs for the same website name (such as naming both google.com and google.com/news as Google), then there could be multiple rows with the same name but different underlying URLs. Looker would typically collapse identical names into one row, but it won’t do so in this case because it is acting as if the url field was also added.

Still have questions?
Go to Discourse - or - Email Support
Top