Skip to main content
Defines cross-topic join keys for the composite topic. A shared dimension handles the case where each topic has its own field for the same logical concept at a different path — for example, an order date in one topic and a campaign start date in another. The shared dimension becomes a single selectable field, and Omni joins each topic’s subquery on its mapped field.
You don’t need a shared dimension for a field that already lives in a shared view — the shared view’s columns are usable as join keys directly.

Syntax

shared_dimensions:
  <dimension_name>:
    label: <string>
    description: <string>
    ai_context: <string>
    display_order: <integer>
    timeframes: [<timeframe>, ...]   # date/timestamp dimensions only
    timeframe_metadata:              # date/timestamp dimensions only
      <timeframe_name>:
        label: <string>
        format: <string>
        group_label: <string>
    mappings:
      <topic_name>:
        field: <view.field>

Properties

shared_dimensions
object
A map of shared dimension definitions, keyed by the dimension’s name. The name becomes the selectable field in the workbook.

Examples

Align orders and marketing by day
shared_dimensions:
  activity_date:
    label: "Activity date"
    description: "Date the order was placed or the campaign was active"
    ai_context: "Use this for any time-series comparison between orders and marketing."
    mappings:
      orders_topic:
        field: orders.created_at
      marketing_topic:
        field: campaigns.start_date
Custom timeframes on shared dimension
shared_dimensions:
  activity_date:
    label: "Activity date"
    timeframes: [date, week, month, quarter]
    mappings:
      orders_topic:
        field: orders.created_at
      marketing_topic:
        field: campaigns.start_date
Custom timeframe labels with timeframe_metadata
shared_dimensions:
  activity_date:
    label: "Activity date"
    timeframes: [date, week, month, quarter, year]
    timeframe_metadata:
      date:
        label: "Day"
      week:
        label: "Week starting"
      month:
        label: "Month of activity"
      year:
        label: "Activity year"
    mappings:
      orders_topic:
        field: orders.created_at
      marketing_topic:
        field: campaigns.start_date