-
Notifications
You must be signed in to change notification settings - Fork 989
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
update measures doc #5737
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
jordan's feedback
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. |
There was a problem hiding this comment.
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
There was a problem hiding this 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`. |
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
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: