Dimensions in filters (aggregation on aggregation) #335
DoctorKatz
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
I understood the code correctly, you are just controlling the order of filters when applied to Datagrid currently support Other thing is that currently datagrid doesn't differentiate the order of filters in the UI and the order of filters when applied to |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, Bogdan!
Thank you for this gem; it's awesome.
In one of my use cases, I added dimensions to filters, similar to how it’s done in the active_reporting gem. When using CTE (Common Table Expressions) tables, these dimensions provide an opportunity to perform aggregation on aggregation, similar to ROLAP.
Here’s a useful case, for example:
Sometimes, I also need to calculate the reverse case: summing all resource consumptions for each day and then taking an average.
To achieve this, I've added grouping by dimension in the filters.
In model I've added scopes like this
And datagrid filters, they look like this:
So, I implemented this for Datagrid v1, but I have some time now, and I can rewrite it, write tests and make a pull request for Datagrid v2 if you're interested in this feature.
Beta Was this translation helpful? Give feedback.
All reactions