Using {{_explore._name}} to extend Explores using the `from` parameter

Knowledge Drop

Last tested: Sep 6, 2019
 

There are occasions when you have an explore where you need to use from to specify the view to use for an aliased Explore. If this Explore is then extended by another Explore, the fields must be referenced with the Explore name (instead of the view name) so you'll see an error if those field references don't reference the extending Explore name.

In this case, we can use the liquid variable {{_explore._name}} to dynamically refer to the Explore name of the Explore being used.

Example

explore: order_items_base {

from: order_items

extension: required

hidden: yes

join: orders {

relationship: many_to_one

sql_on: ${orders.id} = {{_explore._name}}.order_id ;;

}

}



explore: order_items_use {

extends: [order_items_base]

}

This content is subject to limited support.                

Comments
GenDemo
New Member

could you please explain how this is useful?

Version history
Last update:
‎04-05-2021 03:16 PM
Updated by: