Skip to main content
Views representing a data input table or uploaded CSV/XLSX files can’t be used in a join unless the table has been uploaded to a database.
Defines a list of topic-level joins. Joins defined using this parameter will only be available to the topic where they are declared. This can be useful for one-off use cases, rare aliasing, or utilizing different join organization schemes. Refer to the Relationships & Joins documentation for more information about top-level and global relationships. User attributes ({{ omni_attributes.<user_attribute> }}) can be used in joins to create access filtered joins, which can be useful when you want to keep all rows in the dataset but limit access to the metadata.

Syntax

relationships:
  - join_from_view: <view_name>
    join_to_view: <view_name>
    join_to_view_as: <alias>
    join_type: <join_type>
    on_sql: <join_condition>
    relationship_type: <relationship_type>

Properties

relationships
object[]
An array of relationship objects that define topic-level joins. These joins are only available within the topic where they are declared.

Examples

Join order_items to buyers
relationships:
  - join_from_view: order_items
    join_to_view: users
    join_to_view_as: buyers
    join_type: always_left
    on_sql: ${buyers.id} = ${order_items.buyer_id}
    relationship_type: many_to_one
Filtered join using user attributes
relationships:
  - join_from_view: order_items
    join_to_view: users
    join_to_view_as: sellers
    join_type: always_left
    on_sql: ${sellers.id} = ${order_items.seller_id} AND ${sellers.organization_id} = {{ omni_attributes.seller_org_id }}
    relationship_type: many_to_one