Model calls to another model causing duplication

Model calls to another model causing duplication.

We have fixed data model across our customer which is model_analytics.model.lkml and have each customer models as model_cust1.model.lkml  which has user defined attributes specific for each customer. Now the issue as we call model_analytics.model.lkml  inside each customer models we having duplication in labels.

0bd96607-19e7-41c8-9666-ff1189c78df0.png
0 10 239
10 REPLIES 10

Can you explain/show what you’re doing when you say 

 we call model_analytics.model.lkml  inside each customer model

This happens because you in theory have declared the explores twice (once in each model) by including the base model in your customer model. I assume you are doing this because you are extending one or more explores (these won’t be duplicated if you use the same explore declaration name.
To get away from this problem strip each explore out of the base model into their own .explore.lkml file and then include them 1 by 1 in the base. Then in customer model rather than include the base model include only the explores you want.

Or hide the explores in the base and extend and unhide them in customer model.

Or change the model label in customer to make the distinction in the explore menu if you want to expose the explores from the base.

Hi Ian,

We need Base model for each customer as the data model is same across all our customer base. The reason for customer model per customer is for the user defined fields and objects which is unique for each customer. We cannot add all contents from base model to each customer model as every month there is data model change to the base model and is good to make these changes only in base model rather than 1000 plus customer model. How can we hide base model and show all contents only from customer model.

Hi David.,

  Base model contains all common data model for all customer which is very large is base.model.lkml and then we have customer specific model for customer specific user defined field and objects which is very unique only to that customer.

      I am open to a call/zoom if want hop to call to go further details.

Set all explores in base as hidden and then extend in each customer model to unhide.

Hi Ian,

    How do I set all explores in base as hidden? Please give me sample example 

    How do I extend in each customer model to unhide? Please give me sample example 

My base.model (common) sample as below:

explore: invoices {
  view_label: "Invoices"
  label: "Invoices"
  required_access_grants: [analytics_user]

  access_filter: {
    field: account_filter.user_id
    user_attribute: account_filter
  }

  join: account_filter {
    type: inner
    sql_on: ${account_filter.account_id} = ${invoices.account_id} ;;
    relationship: many_to_one
  }

  join: order_account_filter {
    from: account_filter
    view_label: "order account filter"
    type: left_outer
    sql_on: ${order_account_filter.account_id} = ${orders.account_id} ;;
    relationship: many_to_one
  }

  

Q: How do I hide it what is command for it?


customer1.model

# views 
include: "/views/*.view" 
include: "/views/cf_test/f1fb7277a4db19f4fa4041b43beebd6b5ac52de2b486dc51234fbcc29b1a83f2_cf.view.lkml". # user defined feilds and objects customer specific

# Getting Connection from connection.model  
include: "/models/connection.model" 

# models # ToDO should be added
include: "/models/base.model" 

Q: how do I extend in customer1.model as above?

I’m not on laptop right now, you could also change your current (base) model file so it’s not a recognised .model.lkml file by renaming the extension .base.lkml and removing the connection declaration.

this way it won’t create the original explores and the same ones again for the customer model.

there is plenty out there to read about it, google “hub and spoke looker”.

Thanks Ian. If I rename can I still call the base model inside the customer model? I need all explorer in base model to be available in customer model.

Hi Ian,

  I don’t see any option to change the model name to base. (test.model.lkml to test.base.lkml) Also even if gets changed does it get called the same way as test.model.lkml?

5d89ce6a-3cc2-4fd6-8b75-fdf249adc720.png
Top Labels in this Space
Top Solution Authors