Allow specifying measure aggregations that should always return NULL (non-additive measures) #1556
siljamardla
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
MF already has some support for non-additive measures: https://docs.getdbt.com/docs/build/measures#non-additive-dimensions
These enable us to define that a measure should be evaluated as a MIN or a MAX instead of the aggregation defined in the measure for certain dimensions.
There's also another non-additive use case that isn't covered by the existing functionality: for certain granularities return NULL instead of the actual aggregation result. Example: we have a measure sum_revenue_in_local_currency, defined as a SUM of revenue_in_local_currency column. It makes sense to aggregate this metric over different products, different users etc. It does not make sense to aggregate this measure over countries!
Current workaround: post-process these grains to replace the outcome with NULLs. Would be so much better if we could configure MF to immediately return NULL so that users wouldn't make the mistake of addign up different currencies in the first place.
Beta Was this translation helpful? Give feedback.
All reactions