Skip to content

Commit

Permalink
Update measures.md
Browse files Browse the repository at this point in the history
Hi.
This modification proposal contains some comments regarding the lack of several required parameters according to the definition of measures and dimensions, but not present in the added examples.
Also I point out a format issue regarding SQL code.
Regards.
IL.
  • Loading branch information
ialdg authored Apr 3, 2024
1 parent c25a791 commit 52771ac
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions website/docs/docs/build/measures.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ If you use the `dayofweek` function in the `expr` parameter with the legacy Snow

### Model with different aggregations

[comment]: I think that entities, measures and dimensions are attached to particular semantic models. If I'm not wrong. the entities, measures and dimensions present in the following example should have their indentation increased. Also, according to the tables of parameters present in measures (https://docs.getdbt.com/docs/build/measures) and dimensions (https://docs.getdbt.com/docs/build/dimensions), "label" and "type_params" respectively are required parameters and so, they'd be added to the following esample.
```yaml
semantic_models:
- name: transactions
Expand Down Expand Up @@ -125,6 +126,7 @@ semantic_models:
agg: average
- name: transactions_amount_usd_valid #Notice here how we use expr to compute the aggregation based on a condition
description: The total USD value of valid transactions only
[comment]: It'd be a good idea to be coherent, that is, all the SQL clauses in uppercase or in lowercase, but not mixing them. Regarding the option taken, consider that there's another SQL expression some rows downwards.
expr: CASE WHEN is_valid = True then 1 else 0 end
agg: sum
- name: transactions
Expand Down Expand Up @@ -195,6 +197,7 @@ semantic_models:
type_params:
time_granularity: day
[comment]: According to the table of parameters present in measures (https://docs.getdbt.com/docs/build/measures) the "label" is a required parameter and so, it'd be added to the following esample.
measures:
- name: count_users_end_of_month
description: Count of users at the end of the month
Expand Down

0 comments on commit 52771ac

Please sign in to comment.