[SL-1292] Cumulative metric validation allows queries which will not render correctly #825
Labels
bug
Something isn't working
High priority
Created by Linear-GitHub Sync
In Progress
linear
Metricflow
Created by Linear-GitHub Sync
Updated task scope
See sections below for original context.
This task is now to fix the broken validation that allows users to issue cumulative metric queries with time dimensions that our rendering logic does not properly support.
There are three other follow-ups which we need to track:
Original issue details
Cumulative metrics in MetricFlow have two different time axes that they need to consider:
where
inputToday, there are three ways to specify a metric_time filter constraint:
filter
parameters available for a derived metric that uses one or more cumulative metrics as inputwhere
expression at query timestart_time
andend_time
query inputsOf these, only the third one has any awareness of the relationship between the cumulative metric and the metric_time axis - we will automatically expand the time range filter such that all relevant inputs are included. For the other two approaches - which are the current and future standard - we truncate input data according to the filter range specified. This results in confusing outputs.
Imagine a 7-day cumulative metric adding up events per day for the first week of January, 2023. For simplicity, we will assume that there is 1 event per day, which means the 7 day cumulative value for 2023-01-07 should be 7.
Cumulative metrics using raw filter expressions
Input:
mf query --metrics event_count_7d --where "{{TimeDimension('metric_time', 'day')}} = '2023-01-07'"
Output:
Cumulative metrics using start-time/end-time
Input: `mf query --metrics event_count_7d --start-time '2023-01-07' --end-time '2023-01-07'
Output:
Since this is confusing and not in accordance with any reasonable user expectation, we are treating this as a high priority bug for our 1.7 release. The plan for the fix is:
SL-1292
The text was updated successfully, but these errors were encountered: