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 doc #5737

Merged
merged 16 commits into from
Jul 17, 2024
Merged

update measures doc #5737

merged 16 commits into from
Jul 17, 2024

Conversation

mirnawong1
Copy link
Contributor

this pr updates some yaml code exmaples in the measure doc. raised by Zach in dbt community slack: https://getdbt.slack.com/archives/C02CCBBBR1D/p1719959209705599

Outstanding question raised to SL team:

  • Can non_additive_dimensions be used with all metric types? (probably a harder question)

@mirnawong1 mirnawong1 requested a review from a team as a code owner July 4, 2024 08:55
Copy link

vercel bot commented Jul 4, 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 Jul 17, 2024 8:14am

@github-actions github-actions bot added content Improvements or additions to content size: x-small This change will take under 3 hours to fix. Docs team Authored by the Docs team @dbt Labs labels Jul 4, 2024
@github-actions github-actions bot added size: small This change will take 1 to 2 days to address and removed size: x-small This change will take under 3 hours to fix. labels Jul 8, 2024
jordan's feedback
@github-actions github-actions bot added size: medium This change will take up to a week to address and removed size: small This change will take 1 to 2 days to address labels Jul 10, 2024
Since this is a foreign-to-primary relationship, a left join is implemented where the `transactions` semantic model joins the `user_signup` semantic model since the `average_purchase_price` measure is defined in the `transactions` semantic model.
- MetricFlow uses`user_id` as the join key to link two semantic models, `transactions` and `user_signup`. This enables you to query the `average_purchase_price` metric in `transactions`, grouped by the `type` dimension in the `user_signup` semantic model.
- Note that the `average_purchase_price` measure is defined in the `transactions` semantic model, where `user_id` is a foreign entity. However, the `user_signup` semantic model has `user_id` as a primary entity.
- Since this is a foreign-to-primary relationship, a left join is performed where the `transactions` semantic model joins the `user_signup` semantic model since the `average_purchase_price` measure is defined in the `transactions` semantic model.
Copy link
Contributor

Choose a reason for hiding this comment

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

Hiya @mirnawong1

The doc is great and there are no real changes or suggestions I have. The only thing I thought was maybe rewording this sentence "Since this is a foreign-to-primary relationship, a left join is performed where the transactions semantic model joins the user_signup semantic model since the average_purchase_price measure is defined in the transactions semantic model." as SL is ref'd 3 times.

Kind Regards

Copy link
Contributor

@nataliefiann nataliefiann left a comment

Choose a reason for hiding this comment

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

Hiya @mirnawong1

Other than the one comment I left, the PR is great and I've approved this for you. Please let me know if there's anything I can do to help with this.

Kind Regards

Since this is a foreign-to-primary relationship, a left join is implemented where the `transactions` semantic model joins the `user_signup` semantic model since the `average_purchase_price` measure is defined in the `transactions` semantic model.
- MetricFlow uses `user_id` as the join key to link two semantic models, `transactions` and `user_signup`. This allows you to query the `average_purchase_price` metric in the `transactions` semantic model, grouped by the `type` dimension in the `user_signup` semantic model.
- Note that the `average_purchase_price` measure is defined in `transactions`, where `user_id` is a foreign entity. However, `user_signup` has `user_id` as a primary entity.
- Since `user_id` is a foreign key in `transactions` and a primary key in `user_signup`, MetricFlow performs a left join where `transactions` joins `user_signup` to access the `average_purchase_price` measure defined in `transactions`.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks @nataliefiann ! updated/reworded this!

Copy link
Contributor

@Jstein77 Jstein77 left a comment

Choose a reason for hiding this comment

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

LGTM!

@mirnawong1 mirnawong1 enabled auto-merge (squash) July 17, 2024 08:08
@mirnawong1 mirnawong1 merged commit b742af5 into current Jul 17, 2024
11 checks passed
@mirnawong1 mirnawong1 deleted the mwong-update-measures branch July 17, 2024 08:14
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 size: medium This change will take up to a week to address
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants