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

[Spec Update] Support inline metric definitions #56

Open
3 tasks done
Tracked by #7
callum-mcdata opened this issue May 17, 2023 · 0 comments
Open
3 tasks done
Tracked by #7

[Spec Update] Support inline metric definitions #56

callum-mcdata opened this issue May 17, 2023 · 0 comments
Labels

Comments

@callum-mcdata
Copy link
Contributor

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 change to existing dbt-semantic-interfaces functionality, rather than a Big Idea better suited to a discussion

Describe the feature

Say you want to define a derived metric that is a ratio of two measures. In the old world you'd use a ratio metric type but that will no longer exist. So you have two options:

  • Define each measure as its own simple metric with create_metric: true
  • ADDITION: Define the simple metrics inline with the derived metric definition.
metric:
  name: derived_metric
  type: derived
  type_params:
    expr: "metric_a / metric_b"
    metrics:
      - name: metric_a
        type: simple
        type_params:
         - measure: column_a

      - name: metric_b
        type: simple
        type_params:
         - measure: column_b

In the above example, metric_a and metric_b would NOT show up in list-metrics as they are only defined inline to derived_metric. Similar to how dbt uses ephemeral models today.

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

@callum-mcdata callum-mcdata added the enhancement New feature or request label May 17, 2023
@marcodamore marcodamore changed the title [Feature] Support inline metric definitions [Spec Update] Support inline metric definitions May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants