How to hide explores included from model files

Knowledge Drop

Last tested: Mar 17, 2021
 

The Problem

All of our explores are being included when we include a model file in another model file, but we only want to use some not all

A Solution

User refinements to hide these explores. Example if we have model_1;
connection: "model_1_connection"

explore: sales{}

Then we have model_2 where we want to include model_1 but hide sales explore for this model;

include: "/models/model_1.view.lkml"

connection: "model_2_connection"

explore: +sales{

hidden: yes

}

This also works for explores with lots of joins and parameters added to it as the refinement will only update the conflicts which in this case is hidden: no (the default) now has a conflict of hidden: yes which is in the refinement so is used instead in this model. example if sales was larger in model_1 ;

connection: "model_1_connection"

explore: sales{

label: "Sales information"

sql_always_where: ${sales.refund} = false;;

join: users{

sql_on: ${sales.id} = ${users.sales_id};;

}

join: orders{

sql_on: ${users.order_id} = ${orders.id};;

}

}

We still only need to use the following to hide sales;

include: "/models/model_1.view.lkml"

connection: "model_2_connection"

explore: +sales{

hidden: yes

}

This content is subject to limited support.                

Version history
Last update:
‎06-14-2021 06:16 PM
Updated by: