How to join the same table twice (self-join)

Knowledge Drops

Last Tested: March 22, 2021

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.                

Version history
Last update:
‎04-05-2021 09:12 AM
Updated by: