Skip to content

Commit

Permalink
Merge branch 'current' into tlento-ratio-metrics-detail-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Jstein77 authored Aug 7, 2023
2 parents a0c331d + 54fa191 commit f982dfa
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions website/docs/docs/build/metrics-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,33 +98,33 @@ metrics:
### Ratio metrics
[Ratio metrics](/docs/build/ratio) involve a numerator measure and a denominator measure. A `constraint` string can be applied, to both numerator and denominator, or applied separately to the numerator or denominator.
[Ratio metrics](/docs/build/ratio) involve a numerator metric and a denominator metric. A `constraint` string can be applied, to both numerator and denominator, or applied separately to the numerator or denominator.

```yaml
# Ratio Metric
metrics:
- name: cancellation_rate
owners:
- support@getdbt.com
# Ratio metrics create a ratio out of two measures.
# Define the measures from the semantic model as numerator or denominator
# Ratio metrics create a ratio out of two metrics.
# Define the metrics from the semantic manifest as numerator or denominator
type: ratio
type_params:
numerator: cancellations_usd
denominator: transaction_amount_usd
numerator: cancellations
denominator: transaction_amount
filter: | # add optional constraint string. This applies to both the numerator and denominator
{{ Dimension('customer__country') }} = 'MX'
- name: enterprise_cancellation_rate
owners:
- support@getdbt.com
# Ratio metrics create a ratio out of two measures.
# Define the measures from the semantic model as numerator or denominator
# Define the metrics from the semantic model as numerator or denominator
type: ratio
type_params:
numerator:
name: cancellations_usd
name: cancellations
filter: {{ Dimension('company__tier' )}} = 'enterprise' # constraint only applies to the numerator
denominator: transaction_amount_usd
denominator: transaction_amount
filter: | # add optional constraint string. This applies to both the numerator and denominator
{{ Dimension('customer__country') }} = 'MX'
```
Expand Down

0 comments on commit f982dfa

Please sign in to comment.