Joins
Topics
type: topic
label: Customer Analytics
base_view: customers
model_name: my_model
views:
# Simple join using default logic
orders:
join:
join_type: left_outer
relationship: one_to_many
sql_on: ${customers.customer_id} = ${orders.customer_id}
# One-to-many join with multiple columns
order_line_items:
join:
join_type: left_outer
relationship: one_to_many
sql_on: ${orders.order_id} = ${order_line_items.order_id} AND ${customers.customer_id} = ${order_line_items.customer_id}
# Custom join with specific logic
customer_segments:
join:
join_type: left_outer
relationship: many_to_one
sql_on: ${customers.customer_id} = ${customer_segments.customer_id}
# Override default access filters for this join
# This means the access filters will only be applied once at
# the topic-level, instead of individually at the view level
customer_support_tickets:
override_access_filters: true
join:
join_type: inner
relationship: one_to_many
sql_on: ${customers.customer_id} = ${customer_support_tickets.customer_id}Join As: How to join a table in more than once to a topic
Best Practices
Last updated
Was this helpful?

