I want to define as an available aggregation function for a given column the harmonic average using ag-grid. The equation is the following:
where the "weight" is one other column different from the one we want to aggregate and "x" is the column we want to aggregate.
I have made use of the addAggFunc to define a custom aggregation function and printed the params to find out where could the row data be located inside that object, but I could not find it.
this.gridApi.addAggFunc('harmonicAvg', (params) => {
console.log(params);
return 0;
});