This page refers to the
view_labelparameter that is part of a
view_label is a child of
join is a child of
joins is a child of
|view_label: 'desired label'|
view_label will change the way that a group of fields from a joined view will be labeled in the Field Picker:
view_label should only be used when you need more than one view for modeling purposes, but those views represent the same entity to your business users. For example, you might have a customer view and customer_facts view, and want them to retain those names for modeling purposes. However, it might make sense for both of them to appear as Customer to business users.
If you do not explicitly add a
view_label to a
view_label defaults to the name of the join.
If you want to change the names of the fields themselves, you can use the
Make the customer_facts view appear to be part of the customer view in the Field Picker:
Make the product_facts view appear to be part of the product_info view in the Field Picker:
view_label Has No Effect Other Than Changing The Field Picker Appearance
When you change the
view_label of a
join, only the Field Picker is affected. The way that fields should be referenced in the LookML remains unchanged.
Use Proper Capitalization When Combining Multiple Views Via
If you want a joined view to be merged with another view in the Field Picker, you’ll need to make sure that the capitalization you use in
view_label is correct. The capitalization you use should match how the view name appears in the Field Picker. Take this example:
The way that product_info will appear in the Field Picker is Product Info; each word is capitalized, and underscores and changed to spaces. For this reason, we used
view_label: 'Product Info' instead of
Things to Know
There Are Several Ways To Re-label A Joined View
LookML has several different ways to re-name a joined view, all of which have different effects on the way that you write LookML.
view_label is not appropriate for all use cases. This is a brief summary of how to re-name a view:
|Name a view differently than its underlying table, both in the Field Picker and when writing LookML||
|Name a joined view differently than its underlying view, only in the Field Picker||
|Join the same view to an explore multiple times, and apply a unique name to each case, both in the Field Picker and when writing LookML||
|If the same view can describe several different tables, choose the table to be used||