View the original community article here
Last Tested: April 2, 2020
You cannot include a model file in another model file, but if you want to share Explores between models you can create a separate Explore file, then use include
to reuse or extend Explores in different models.
Example
Let's say you want to extend the salesforce_account_summary
Explore from the finance
model into the marketing
model.
-
Pull out the explore into a new explore file that has no connection defined. Delete it from
finance
.
File base.explore.lkml:explore: salesforce_account_summary { ... }
-
Include this base file into the
finance
model.
File finance.model.lkml:connection: "thelook" include: base.explore.lkml
-
Include the base file into the
marketing
model and then extend the explore.
File marketing.model.lkml:connection: "thelook" include: base.explore.lkml explore: firmagraphics { extends: [salesforce_account_summary] view_name: salesforce_account_summary }
This content is subject to limited support.