primary_key

LookML
Version

On this Page
Docs Menu

Go to Field Parameter List

Definition

The primary_key parameter specifies that a dimension is the primary key for its view. The default value is false. For example:

- dimension: id primary_key: true sql: ${TABLE}.id

The primary_key parameter:

If you have a primary key that is comprised of multiple columns, you can create a dimension that concatenates those columns, then declare that as your primary key. For example:

- dimension: primary_key primary_key: true sql: CONCAT(${TABLE}.promotion_id, ${TABLE}.sku)

Please note that a dimension_group cannot be used as a primary key if it specifies more than one timeframe.

Still have questions?
Go to Discourse - or - Email Support
Top