view

LookML
Version

On this Page
Docs Menu

Go to Explore Parameter List

This page refers to the view parameter that is part of an explore

view can also be used to define a view, described here

Usage

view is a child of
explore
explore: explore_name
...
1st
Tab
view: underlying_view
the name of an existing view

Definition

view determines the view that will define the fields of an explore. If view is omitted, Looker will assume that the underlying view name is the same as the explore name. Typically view is only used if you need to create multiple explores from the same view.

Examples

Add an option to the Explore menu called customer based on the view called user

- explore: customer view: user

Common Challenges

view, from, and label Are Often Confused But Have Different Behaviors

In addition to view, there is also a from parameter and a label parameter that have similar, but different effects.

Using view

You should use view if you want to create multiple explores from the same view, and you want to reference fields the same way for each explore:

- explore: customer view: user # Would appear in the Explore menu as "Customer" # Fields would appear like "User Name" # You would reference fields like ${user.name}   - explore: buyer view: user # Would appear in the Explore menu as "Buyer" # Fields would appear like "User Name" # You would reference fields like ${user.name}

Using from

You should use from if you want to create multiple explores from the same view, and you want to reference fields differently for each explore:

- explore: customer from: user # Would appear in the Explore menu as "Customer" # Fields would appear like "Customer Name" # You would reference fields like ${customer.name}   - explore: buyer from: user # Would appear in the Explore menu as "Buyer" # Fields would appear like "Buyer Name" # You would reference fields like ${buyer.name}

Using label

You should use label if you don’t need to create multiple explores from the same view, and you just want the explore’s name to appear differently in the Explore menu:

- explore: user label: 'Customer' # Would appear in the Explore menu as "Customer" # Fields would appear like "User Name" # You would reference fields like ${user.name}

Things to Know

view Is Rarely Used With explore

It’s not very common to use view to re-name an explore, unless you happen to be creating an extended model and need to create multiple explores from the same view. If this is not your situation, consider if you can simply rename the underlying view instead, or use label.

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