Knowledge Drop

How can I extend a model file?

  • 5 April 2021
  • 0 replies

Userlevel 5
  • Looker Staff
  • 173 replies

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.


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.                



0 replies

Be the first to reply!