This page refers to the
extendsparameter that is part of a view.
extendscan also be used as part of an Explore, described on the
extends(for Explores) parameter documentation page.
extendscan also be used as part of a LookML dashboard, described on the Dashboard parameters documentation page.
extends: [view_name, view_name, …]
AcceptsSquare brackets containing a comma-separated list of view names
extends parameter allows you to build upon the content and settings from another view file, using the other view file as a starting point. If there are any conflicts, the extending view will use its own settings, overriding the settings of the view being extended. See Reusing code with extends for the details of how Looker does this.
Check out LookML refinements.
Extending a view or an Explore is ideal for scenarios where you want to have multiple versions of the view or Explore. But if your goal is simply to modify a view or an Explore without editing the LookML file that contains it, you may want to use a refinement instead.
You can also use an
extendsparameter inside a refinement.
See the LookML refinements documentation page for more information and use cases.
When extending a view, it’s important to use the
sql_table_name parameter on the view that is going to be extended, if it’s not already there. The
sql_table_name parameter defines the table in your database that will be queried by a view. For any view the default value is the name of the view. So, if you aren’t already using
sql_table_name, simply give it the same value as your view name.
It’s also important that in our new view file we use the
include parameter to point to the filename of the view we want to extend.
Avoid extending views that are based on persistent derived tables (PDTs). Each extension of a PDT will create a new copy of the table in your database. In this case, you may want to use LookML refinements instead. See the LookML refinements documentation page for more information and use cases.
Here’s an example view file that we can extend. The view is named
looker_events and the view’s filename is
Now we’ll create a new view file and define a view that extends the
looker_events view. In our new file, we must use the
include parameter to point to the file name of the view we want to extend:
And then we’ve added a new measure that will show in our new view in addition to all the dimensions and measures that are defined in the
looker_events view that we extended.
Using metadata to see extensions for an object
If your Looker admin has enabled the IDE Metadata Sidebar Labs feature, you can click on an
explore or a
view parameter in the Looker IDE and use the metadata panel to see any extensions on the object, or to see what object it extends. See the Metadata for LookML objects documentation page for information.
Things to consider
When extending an object, be aware that localization rules apply to your extensions as well. If you are extending an object and then defining new labels or descriptions, you should provide localization definitions in your project’s locale strings files. See the Localizing your LookML model documentation page for more information.