from

LookML
Version

On this Page
Docs Menu

Go to Explore Parameter List

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

from can also be used as part of a join, described here

Usage

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

Definition

from determines the view that will define the fields of an explore. If from is omitted, Looker will assume that the underlying view name is the same as the explore name. Typically from is only used if you want the explore and its fields to have a different name than the underlying view.

To make this more clear, consider an example where a dimension called order_value has been created in a view called underlying_view:

  • This field would typically appear as UNDERLYING VIEW Order Value in the Explore UI, and would be referenced in LookML with ${underlying_view.order_value}
  • In the usage example given above, the field would appear instead as NEW ALIAS NAME Order Value and be referenced as ${new_alias_name.order_value}

Examples

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

- explore: customer from: user

Common Challenges

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

As seen above, from has many effects on the way that an explore is labeled and the way that fields are referenced. There is also a view parameter and a label parameter that have similar, but different effects.

Using from

You should use this option if you want to create multiple explores from the same view and also 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 view

You should use this option 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 label

You should use this option if you don’t need to create multiple explores from the same view, but 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

from Is Rarely Used With explore

It’s not very common to use from to re-name an explore. Although there are legitimate use cases, if you find yourself wanting to use this parameter, consider if you can simply rename the underlying view instead. It’s much more common to rename joins using the join-level from parameter.

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