Search code examples
ag-gridag-grid-angular

Can AG-Grid aggregate the same field in multiple ways simultaneously (Avg, Max, Min, Sum)?


I have an ag-grid pivot table with system CPU data that is grouped at the year/month level. For each day of the month, I have a machine name and a CPU load.

I would like to be able to show the CPU load field's monthly max, as well as average, in the same pivot table.

Ag-grid does not let me drag the column into the "Values" section more than once, meaning I can only show one calculated column at a time.

If I duplicate the CPU field column definition (so that there are two identical column defs), I am able to accomplish what I want (showing both max and average columns at the same time).

Is there a way to do this without this "hack"?

Here's an edited photo showing what I'm trying to accomplish: modified ag-grid pivot example


Solution

  • Your workaround is good, until it's implemented in ag-grid. They have it as feature requests AG-6770 and AG-2986 in their backlog.

    AG Grid Pipeline screenshot with the two feature requests