[X] I have searched the existing issues, and I could not find an existing issue for this feature
[X] I am requesting a straightforward change to existing dbt-semantic-interfaces functionality, rather than a Big Idea better suited to a discussion
Describe the feature
Context
Some metrics require multiple aggregations or dependencies on other metrics. For example, Streamlit measures “super users” which is calculated as a distinct count of users who have 10+ active days in the last 70 days. Notion measures “activated spaces” which is calculated as a distinct count of spaces where at least two users have two active days within the first 7 days of space creation. Both of these metrics require dependencies on some aggregation in order to produce the end metric and MetricFlow has no path to supporting this today. This paradigm is sometimes called “metrics as dimensions” by our users where an aggregation is an input to the metric definition.
Our plan to support this enable referencing a metric in a filter.
The general interface update is:
Parameter
Description
Type
metric:filter
The filter condition applied to a metric. Previously this required the “Dimension(’dim_name’”) object syntax. You would now be able to reference metric and list of group by parameters i.e “Metrics(metric='', group_by=[])”
Required
For example in a metric config:
metrics:
- name: The metric name
type: Categorical or Time or Aggregation
type_params: specific type params
filter: | ##The metric filter. Can now reference a metric and associated dimensions or
{{Metric('metric_name', group_by=['list of entities or dimensions])}}
Is this your first time submitting a feature request?
Describe the feature
Context
Some metrics require multiple aggregations or dependencies on other metrics. For example, Streamlit measures “super users” which is calculated as a distinct count of users who have 10+ active days in the last 70 days. Notion measures “activated spaces” which is calculated as a distinct count of spaces where at least two users have two active days within the first 7 days of space creation. Both of these metrics require dependencies on some aggregation in order to produce the end metric and MetricFlow has no path to supporting this today. This paradigm is sometimes called “metrics as dimensions” by our users where an aggregation is an input to the metric definition.
Our plan to support this enable referencing a metric in a filter.
The general interface update is:
For example in a metric config:
In a CLI query:
Describe alternatives you've considered
No response
Who will this benefit?
No response
Are you interested in contributing this feature?
No response
Anything else?
No response