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

add new cookbook section with usecases #5757

Open
wants to merge 46 commits into
base: current
Choose a base branch
from
Open

Conversation

@mirnawong1 mirnawong1 requested a review from a team as a code owner July 9, 2024 14:59
Copy link

vercel bot commented Jul 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-getdbt-com ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 27, 2025 11:56am

@github-actions github-actions bot added content Improvements or additions to content guides Knowledge best suited for Guides Docs team Authored by the Docs team @dbt Labs size: large This change will more than a week to address and might require more than one person labels Jul 9, 2024
Copy link

@ericalouie ericalouie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor suggestions!

website/docs/guides/sl-cookbook-recipes.md Outdated Show resolved Hide resolved
website/docs/guides/sl-cookbook-recipes.md Outdated Show resolved Hide resolved
website/docs/guides/sl-cookbook-recipes.md Outdated Show resolved Hide resolved
website/docs/guides/sl-cookbook-recipes.md Outdated Show resolved Hide resolved
```
</File>

2. Add the following YAML configurations in that same semantic model file:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will make sure all yaml examples align with paragraphs/text

```
<!-- Cookbook 4 -->

## How to join multiple fact metrics
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @patkearns10 - would love your feedback and perspective on this join metrics section if you have time!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple quick changes, but otherwise looks good to me!

- name: cac
description: "Customer acquisition cost"
label: 'CAC'
type: ratio
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ratio metrics require metrics as inputs for numerator, denominator. So we will need to define those metrics too (right now it seems like we are trying to use the measures)

website/docs/guides/sl-cookbook-recipes.md Outdated Show resolved Hide resolved
```
<!-- Cookbook 4 -->

## How to join multiple fact metrics
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple quick changes, but otherwise looks good to me!

- [`dimensions`](/docs/build/dimensions) to specify time dimensions (such as `date_day`)
- [`measures`](/docs/build/measures) for a distinct count of active users (`count_activity_users`) aggregated by day.
<br />
<File name="models/semantic_models/sem_user_activity_daily.yml">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[custom.Typos] Oops there's a typo -- did you really mean 'sem_user_activity_daily'?

dbt Cloud (ie. Deployment and Development)
model: ref('fct_user_activity_daily')
defaults:
agg_time_dimension: date_day
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[custom.Typos] Oops there's a typo -- did you really mean 'agg_time_dimension'?

dbt Cloud (ie. Deployment and Development)
model: ref('fct_user_activity_daily')
defaults:
agg_time_dimension: date_day
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[custom.Typos] Oops there's a typo -- did you really mean 'date_day'?


entities:
#--- user entities
- name: user_daily
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[custom.Typos] Oops there's a typo -- did you really mean 'user_daily'?

#--- user entities
- name: user_daily
type: primary
expr: user_activity_daily_id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[custom.Typos] Oops there's a typo -- did you really mean 'user_activity_daily_id'?

description: >
Distinct count of users via `fct_user_activity_daily`.
To be used in metrics related to User-level activities
(e.g. Active Users)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[custom.Typos] Oops there's a typo -- did you really mean 'e.g.'?

Distinct count of users via `fct_user_activity_daily`.
To be used in metrics related to User-level activities
(e.g. Active Users)
agg: count_distinct
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[custom.Typos] Oops there's a typo -- did you really mean 'count_distinct'?

To be used in metrics related to User-level activities
(e.g. Active Users)
agg: count_distinct
expr: user_id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[custom.Typos] Oops there's a typo -- did you really mean 'user_id'?

(e.g. Active Users)
agg: count_distinct
expr: user_id
agg_time_dimension: date_day
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[custom.Typos] Oops there's a typo -- did you really mean 'agg_time_dimension'?

(e.g. Active Users)
agg: count_distinct
expr: user_id
agg_time_dimension: date_day
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[custom.Typos] Oops there's a typo -- did you really mean 'date_day'?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Improvements or additions to content Docs team Authored by the Docs team @dbt Labs guides Knowledge best suited for Guides size: large This change will more than a week to address and might require more than one person
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants