Structured aggregation_method for Metrics #19
Replies: 3 comments 3 replies
|
Distinguishing between metric types has many important applications. Establishing lineage for derived metricsUnderstanding the lineage of derived metrics is a must. Consider the example of a profitability metric that relies on the total cost and the total revenue metric, which in turn involve components from N different business lines etc. For clearly understanding what is involved and how in the profitability metric we can look into the upstream components (metrics) that feed into this metric. Directing downstream behaviourWe need to distinguish different aggregation behaviours in metrics. And I imagine downstream tools making use of these distinctions.
|
|
A simplification of this might be to create a set of OSI_ aggregate functions that can get interpreted expanded by the various implementations. The advantage here is that you can write much more complex metrics (measures). When we compile an OSI model, we should be able to generate the downstream recompose-ability that @siljamardla describes above. I'm not sure we need to add more meta-data to the model, it should be derivable. BTW: I'm a believer that metrics belong in datasets, not as a top level thing). There are many ways to compute |
|
Supporting data point from the ThoughtSpot mapping (#285): beyond structured aggregation, there's currently no way to declare a metric semi-additive (e.g. account balances, summable across accounts, not across time). Snowflake's semantic views express this with non_additive_dimensions, ThoughtSpot has an equivalent concept, and OSI's Decomposability idea is unreachable from a model document today. If this proposal moves, semi-additivity would be worth including in the same structure. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Problem
String expressions require parsing and have cross-platform incompatibilities:
Some platforms interpret definitions rather than execute SQL directly.
Per Tom Lento's comment on the original OSI proposal: "Primitive types are restrictive and using strings to allow flexibility causes a lot of problems down the line."
Proposal
Metrics have either of the following but not both
aggregation_methodenum for common aggregations: sum, min, max, average, count_distinct, percentileaggregation_paramsfor aggregation-specific settingsdatasetandfieldexpressionwith dialect. These can reference other metrics and dimensionsExamples
All reactions