Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update measures.md #5219

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading