Skip to main content
This is used to dedupe over a different aggregation level than the default behavior. For example, aggregation over an intermediate table or another key. This can be used for similar use cases to level-of-detail calculation.

Syntax

<measure_name>:
  sql: <field>
  aggregate_type: sum_distinct_on
  custom_primary_key_sql: ${<view_name>.<field_name>}

Properties

measure_name
object[]
The name of the measure.

Examples

Dedupe using id
distinct_price:
  sql: price
  aggregate_type: sum_distinct_on
  custom_primary_key_sql: ${id}