View the original community article here
Last Tested: March 22, 2021
Join a view to itself (self join) is easy to achieve. In a given explore, each join name must be unique. To self join the same table multiple times you can use the from
parameter, as mentioned in the docs, to change the "join" name of the table.
In this example, we join in person
to order
twice, with different names and different joining dimensions.
explore: order {
join: person {
sql_on: ${order.customer_id} = ${person.id} ;;
}
join: representative {
from: person
sql_on: ${order.representative_id} = ${representative.id} ;;
}}
This content is subject to limited support.