Knowledge Drop

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

  • 6 April 2021
  • 1 reply
  • 54 views

Userlevel 4

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.                

 

 


1 reply

Userlevel 3

could you please explain how this is useful?

Reply