Skip to main content
A better alternative to this parameter is to ceate a concatenated field that contains those fields, and then define the dimension-level parameter of primary_key: true for that field. This increases readability and potentially simplifies debugging primary key-related errors.
primary_key_field:
  sql: concat(${field_1},'-',${field_2})
  primary_key: true
  hidden: true

Syntax

custom_compound_primary_key_sql: [ field1, field2, ... ]

Properties

custom_compound_primary_key_sql
array
An array of field names that match the dimension names in your view definition. Note: When the view is saved, Omni will automatically format field references according to your database type:
  • Snowflake - Field names are automatically converted to uppercase and wrapped in double quotes. For example,[ id, created_at_month ] will become [ '"ID"', '"CREATED_AT_MONTH"' ]
  • Google BigQuery - Field names remain as entered without additional quotes. For example, [ id, created_at_month ] will remain as-is.

Examples

Compound primary key of id & created month
custom_compound_primary_key_sql: [ id, created_at_month ]