Skip to content

Commit 715e243

Browse files
Remove incorrect sum_distinct example YAML snippet
Generated-By: mintlify-agent
1 parent 69c969d commit 715e243

1 file changed

Lines changed: 0 additions & 32 deletions

File tree

references/metrics.mdx

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -974,38 +974,6 @@ If the value you are aggregating is truly distinct based on the distinct key (e.
974974
</Tab>
975975
</Tabs>
976976

977-
**Using multiple distinct keys**
978-
979-
If you need to factor in multiple fields for deduplication, you can specify multiple keys. For example, if you want to sum values that are unique per combination of `order_id` AND `shipping_cost`:
980-
981-
```yaml
982-
metrics:
983-
total_line_item_revenue_deduped:
984-
type: sum_distinct
985-
sql: ${line_item_total}
986-
distinct_keys: [line_item_id]
987-
description: >
988-
Total line item revenue correctly deduped. Each line item's total is
989-
summed once, regardless of how many payments the order has.
990-
format: usd
991-
round: 2
992-
```
993-
994-
Or to deduplicate by multiple fields:
995-
996-
```yaml
997-
metrics:
998-
total_shipping_cost:
999-
type: sum_distinct
1000-
sql: ${order_shipping_cost}
1001-
distinct_keys: [order_id, order_shipping_cost]
1002-
```
1003-
1004-
<Note>
1005-
When using multiple distinct keys, a row is considered unique only when the entire combination of key values is unique.
1006-
</Note>
1007-
1008-
1009977
### string
1010978

1011979
Used with fields that include letters or special characters.

0 commit comments

Comments
 (0)