[Feature request] Post-aggregate measure filters #8804
Description
Hi!
Based on the Cube roadmap (#8486), we understand that you are currently working on post-aggregate metrics and dimensions.
We found a guide on how to calculate cohort retention (https://cube.dev/docs/guides/recipes/analytics/cohort-retention). However, the method described there is not dynamic and consumes significant resources due to the need for joins that multiply the dataset several times.
Moreover, if we want to segment the data by a dimensions other than date (e.g., device type, date, country, ...), we would need to rewrite the main SQL query.
In our testing of post-aggregate measures, we noticed that properties like reduce_by
and group_by
could potentially solve this issue. However, if Cube applies all filters to each post-aggregate measure, it can cause complications.
We suggest adding a specific parameter that allows defining which filters are applied to a particular measure if parameter is set. This would enable truly dynamic cohort analysis.
For example, by adding a property like:
propagate_filters: [dim1, dim2, ...]