Usage
view_name: view_name
}
Hierarchyview_name |
Default ValueA view whose name matches the Explore’s nameAcceptsThe name of an existing view |
Definition
view_name
determines the view that will define the fields of an Explore. If view_name
is omitted, Looker assumes that the underlying view name is the same as the Explore name. Typically view_name
is only used to create multiple Explores from the same view.
Examples
Add an option to the Explore menu called Customer based on the view called user
:
Common challenges
view_name
, from
, and label
are often confused but have different behaviors
view_name
, from
and label
parameters have similar, but different effects.
Using view_name
Use view_name
to create multiple Explores from the same view, and reference fields the same way for each Explore:
With view_name: user
, the generated SQL uses the original table name, like this: FROM schema.users AS users
.
Using from
Use from
to create multiple Explores from the same view, and reference fields differently for each Explore:
With from: user
, the generated SQL aliases the original table name, like this: FROM schema.users AS customer
.
Using label
Use label
if you don’t need to create multiple Explores from the same view, and you want the Explore’s name to appear differently in the Explore menu:
Things to know
view_name
is rarely used to rename an Explore
It is uncommon to use view_name
to rename an Explore, unless you are creating an extended model and need to create multiple Explores from the same view.
Consider renaming the underlying view or using label
to change how the Explore appears in the field picker.