mui-x
mui-x copied to clipboard
[data grid] Implement Pivoting
What a pivot table is?
TLDR
Transform row data from given selected field(s) into column headers; values under these columns are aggregations of all the rows that share the same value on the selected fields(s)
A pivot table is a statistics tool that summarizes and reorganizes selected columns and rows of data in a spreadsheet or data table to obtain a desired report.
It’s an extension of the behavior of combining row grouping and aggregation. With the ability to pivot columns, users can break down the row-grouped values in a new dimension, and the aggregation functions are used to compute the crossed values between rows and columns.
It’s a tool that targets end-users and enables them to build a new table by combining different computed values based on the original dataset.
How does pivoting work?
A pivot table is built over four distinct concepts.
-
Rows: When a field is chosen to provide the rows, it populates the first column with the unique values of that field. It’s the logic of
Row grouping
. -
Columns: When a
field
is set for the columns, the unique values of that field are listed across the top as column headers. It is similar toRow grouping
, but with columns. This property is what effectively gives the sense of data pivoting. -
Computed values: When a field is chosen, its values are aggregated based on the cross between rows and columns established by the previous inputs. The most common aggregation are sum, average, minimum and maximum.
It’s the logic from
Aggregation
, but extended to aggregate the value in multiple columns represented by a field’s unique values. - Filters: Filters original dataset.
Examples of use cases
-
Extracting the sum of gold medals per country each year:
Original dataset
Row group: Country, Columns: Year, Computed Values: Gold (sum)
Row group: Year, Columns: Country, Computed Values: Gold (sum)
When a user turns on the pivoting:
- The Data Grid stops displaying the original dataset
- The Data Grid displays the tool for building the pivot table:
- A list of all the available fields.
- 3 inputs for columns, rows, and computed values.
- Access to the filter panel to apply filters to the original dataset
- The Data Grid renders the pivot table based on which fields are used on each of the four inputs.
Where can users access this function?
At the new “Manage columns” panel https://github.com/mui/mui-x/issues/5700
Challenges
- UI/UX design of a pivoting panel
- Rendering autogenerated Columns (maybe Column definitions)
- Crossing Aggregation (Rows vs columns)
Benchmark
- https://airtable.com/marketplace/blkyAnUVk7O0NMrQp/pivot-table
- https://help.tableau.com/current/prep/en-us/prep_pivot.htm
- https://www.ag-grid.com/javascript-grid-pivoting/
- https://ej2.syncfusion.com/react/demos/#/material/pivot-table/default
- https://demos.telerik.com/kendo-ui/pivotgrid/index
- https://demos.telerik.com/kendo-ui/pivotgridv2/index
- https://webix.com/pivot/
- https://www.htmlelements.com/docs/pivot-table/
- https://js.devexpress.com/Demos/WidgetsGallery/Demo/PivotGrid/Overview/jQuery/Light/
- Excel

im looking foward to it :D
Has this been confirmed to be in Jul - Sep timeframe?
Is this still due for Q4? Hoping to see it soon!
I thought we are the only one who always extend the deadline :laughing:
Is this feature coming out by the end of this year?
This feature will come out in ....
We don't yet have a deadline for this feature. We have changed the roadmap presentation a bit. We now have an internal roadmap where we set ambitious targets and a public one where we try to under promise, so we can more consistently overdeliver.
Main issue for me is that I can't make column headers stick - not being scrolled out. Maybe there is a way but I didn't see it.
@KlausFabian Is this what you're looking for? https://mui.com/components/data-grid/columns/#column-pinning
@m4theushw That looks exactly what I have been looking for!!! Thanks a lot. But does that only work with the DataGridPro?
Hoping to see this re-prioritized - my team will definitely use this as soon as it's available.
Looking forward to this new feature! Hope it can be prioritized
Also need this!
WE NEED THIS!
As a customer we would like to see this re-prioritized
I am new customer too; also please re-prioritized this would be amazing
We are in need of this feature very much, Please re-prioritize this.
I'm happy to listen to your pain points, expectations, and use cases. Let us know if you're willing to give us a user interview.
Hi @joserodolfofreitas ; thats an amazing initial point; we would love yo see that; let us know and in the future if any testing needed. Also; probably would connect soon; there were some issues with the export excel functionality. Kind regards, Ricardo
We really need this feature to make datagrid even more powerful!
That's killer for us!
Any updates on this ?
Second that. I feel like this feature is a must.
+1
+1
+1, Please add the feature asap. We need this for our new saas.
I am dam sure many people are ready to take higher plan for the same.
Can anyone please please provide ETA for this
Can anyone please please provide ETA for this
I do not look forward to, can not afford, Ha Ha
Really need this asap! We're on the pro now, we will upgrade to premium if this will be released soon!
+1 for this feature