How can I extend a model file?

Knowledge Drop

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.

  1. 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 { ... }

  2. Include this base file into the finance model.
    File finance.model.lkml:
    connection: "thelook" include: base.explore.lkml

  3. 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.                

Version history
Last update:
‎04-05-2021 09:13 AM
Updated by: