You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues, and I could not find an existing issue for this feature
I am requesting a straightforward extension of existing metricflow functionality, rather than a Big Idea better suited to a discussion
Describe the feature
I would like to be able to reference dimensional attributes of another model when defining Measures.
This is needed when defining aggregate values that combine fact and dimension tables in dimensional modeling.
Example:
semantic_models:
- name: order_factmodel: ref('fct_order')entities:
- name: order_facttype: primaryexpr: order_key
- name: user_dimensiontype: foreignexpr: user_keymeasures:
- name: number_of_unique_usersagg: count_distinctexpr: "{{ Dimension('user_dimension__user_id') }}"# Enable this syntax (Encountered an error: Compilation Error Could not render {{ Dimension('user_key__user_id') }}: 'Dimension' is undefined)
fct_order:
order_key
user_key
order_id
order_date
order_price
1
1
o1
2025-01-01T00:00:00
1000
2
2
o2
2025-02-01T00:00:00
1200
3
3
o3
2025-03-01T00:00:00
800
dim_user:
user_key
user_id
state_code
1
u1
NY
2
u1
CA
3
u2
CA
Describe alternatives you've considered
Store user_id as a degenerate dimension in the fact table.
Jstein77
changed the title
[Feature] Allow use dimensional attributes of another model when defining a measure.
[SL-3321] [Feature] Allow use dimensional attributes of another model when defining a measure.
Jan 28, 2025
Is this your first time submitting a feature request?
Describe the feature
I would like to be able to reference dimensional attributes of another model when defining Measures.
This is needed when defining aggregate values that combine fact and dimension tables in dimensional modeling.
Example:
fct_order:
dim_user:
Describe alternatives you've considered
Store
user_id
as a degenerate dimension in the fact table.Example:
fct_order:
dim_user:
Pros:
Cons:
Who will this benefit?
Data teams implementing dimensional modeling (star schema).
Are you interested in contributing this feature?
No response
Anything else?
In Looker, it looks like it can be defined as follows.
Warning
I'm not an expert on Looker, so the specification itself or the syntax may be incorrect.
SL-3321
The text was updated successfully, but these errors were encountered: