-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[data grid] In grouped rows: How to determine value based on other columns' values #15083
Comments
Hey @stivluc please could you provide a minimal reproduction of your example? I have an idea for how to solve it with |
Hi, thanks for your help and sorry for lack of info. So my API send data in this format:
In my DataGrid, rows are always grouped by DATLIV and CODACT. Here is my column definition: I can't have the desired result and have to use one of the default aggregations for example average to calculate the progress, which isn't accurate. Thanks for your help! |
@stivluc does this do what you're looking to achieve? https://codesandbox.io/p/sandbox/15083-row-group-derived-aggregation-cd8cx3 |
It does!! Thanks a lot for your help I'll have to study this as it will be very useful all accross my app. |
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Note @stivluc How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey. |
Glad to hear it @stivluc - let me know if you have any follow up questions. |
The problem in depth
For some columns of my datagrid, the value depends on other columns' values, using
valueGetter: (params) => params.row.quantity / params.row.total
I need to calculate those values also on grouped row.
Current behavior: params.row.XXX returns undefined on grouped row
For the grouped rows, we can currently only display aggregations like sum, avg, etc. But an avg of progresses for example is totaly wrong because it depends on the sum of quantities.
Example here:
Progress for 10/25/2024 should be (15,936 - 3384 - 567) / 15936 = 75% but it currently displays an average of the sums.
It should display the value according to the three columns right of it.
Your environment
`npx @mui/envinfo`
Search keywords: Grouped row aggregations
Order ID: 80196
The text was updated successfully, but these errors were encountered: