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

[Feature] Allow metrics in semantic layer filters #9804

Closed
3 tasks done
courtneyholcomb opened this issue Mar 22, 2024 · 0 comments · Fixed by #9773
Closed
3 tasks done

[Feature] Allow metrics in semantic layer filters #9804

courtneyholcomb opened this issue Mar 22, 2024 · 0 comments · Fixed by #9773
Assignees
Labels
enhancement New feature or request

Comments

@courtneyholcomb
Copy link
Contributor

courtneyholcomb commented Mar 22, 2024

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • 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 dbt functionality, rather than a Big Idea better suited to a discussion

Describe the feature

Allow referencing metrics in filters for metrics, measures, and saved queries. See more detail in the DSI issue here: dbt-labs/dbt-semantic-interfaces#273

Currently, only references to Dimensions are allowed within filters like this:

metrics:
  - name: The metric name
    type: Categorical or Time or Aggregation
    type_params: specific type params 
    filter: |
      {{ Dimension('entity__name') }} > 0 and {{ Dimension(' entity__another_name') }} is not null

Afterwards, references to Metrics are also allowed like this:

metrics:
  - name: The metric name
    type: Categorical or Time or Aggregation
    type_params: specific type params 
    filter: |
      {{ Metric('bookings', ['user']) }}

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants