[SL-2217] [Feature] Support period-over-period calculations at query time #1220
Labels
enhancement
New feature or request
Low priority
Created by Linear-GitHub Sync
Metricflow
Created by Linear-GitHub Sync
Todo
Is this your first time submitting a feature request?
Describe the feature
Problem Overview
It’s common for customers to need to calculate the period-over-period change of a metric. Some common examples of this are measuring headcount change quarter over quarter, or tracking year-over-year revenue growth. Our current path for supporting period-over-period calculations in the semantic layer is to use derived metrics and offsets to create a new metric that explicitly tracks the period-over-period value. This leads to extra YAML boilerplate in your configs that your data engineering team now needs to manage.
We want to reduce the amount of configuration your data team needs to manage. Implementing period-over-period calculations currently means that a single revenue metric balloons into every combination of period comparison that you need, i.e.,
revenue_quarter_over_quarter
,revenue_year_over_year
,revenue_month_over_month
, etc. Instead of forcing customers to configure static period-over-period metrics in configs, we should be able to dynamically calculate the period-over-period value at query time. This means you only need to configure your revenue metric once to make any period-over-period view available to your organization.Proposed Solution
Our proposed solution is to allow users to select a period-over-period comparision at query time. An example using the cli syntax is
dbt sl query --metrics revenue__mom --group by metric_time__day
. This query would return the value month over month percentage change of revenue grouped by day.Describe alternatives you've considered
You can define separate metrics for period over period calculations that explicitly define the offset in the metric configurations.
Who will this benefit?
No response
Are you interested in contributing this feature?
No response
Anything else?
No response
SL-2217
The text was updated successfully, but these errors were encountered: