View the original community article here
Last tested: May 11, 2020
Since a dimension group is a collection of dimensions, you can't make it a primary key. Instead, make a single dimension with one timeframe, and let that be your primary key.
So if you have:
dimension_group: created {
type: time
timeframes: [time, month, year]
sql: ${TABLE}.created_at ;;
}
Then you can add a new dimension:
dimension: created_pk {
type: string
hidden: yes
primary_key: yes
sql: ${created_time} ;;
}
Here we add hidden
because created_time
is already in the dimension group.
This content is subject to limited support.