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
When defining a metric, it's possible to specify a filter for the measure. For example, to define the canada_bookings metric, you could use the bookings measure with the filter that uses the country dimension. Previously, in specifying the filter, the user would specify the filter as raw SQL like listing__country == 'ca'. The dunder syntax was used to specify the entity path / join path so that the right dimension was used (e.g. not guest__country). There were a couple of issues with this approach.
We're moving away from the dunder syntax as it's difficult to specify additional qualities about the entity path.
To extract the dimensions that are used, the filter needed to be parsed via a SQL parser, which could be error prone with the variety of SQL dialects and new features.
Instead, the proposal is to support templating in the filter string, so that future path specifications will be easier to support. e.g. {{ dimension('listing', entity_path=['listing'] }} == 'ca'. In addition, the use of a template will eliminate the need for SQL parsing.
Describe alternatives you've considered
See previous implementation in the description.
Who will this benefit?
With the templated syntax, there will be fewer issues supporting new SQL engines and enable us to later add improved join path specification.
Are you interested in contributing this feature?
Yes
Anything else?
No response
The text was updated successfully, but these errors were encountered:
Is this your first time submitting a feature request?
Describe the feature
When defining a metric, it's possible to specify a filter for the measure. For example, to define the
canada_bookings
metric, you could use thebookings
measure with the filter that uses thecountry
dimension. Previously, in specifying the filter, the user would specify the filter as raw SQL likelisting__country == 'ca'
. The dunder syntax was used to specify the entity path / join path so that the right dimension was used (e.g. notguest__country
). There were a couple of issues with this approach.Instead, the proposal is to support templating in the filter string, so that future path specifications will be easier to support. e.g.
{{ dimension('listing', entity_path=['listing'] }} == 'ca'
. In addition, the use of a template will eliminate the need for SQL parsing.Describe alternatives you've considered
See previous implementation in the description.
Who will this benefit?
With the templated syntax, there will be fewer issues supporting new SQL engines and enable us to later add improved join path specification.
Are you interested in contributing this feature?
Yes
Anything else?
No response
The text was updated successfully, but these errors were encountered: