pat310 / quick-pivot

Quickly format data to create a pivot table
https://www.npmjs.com/package/quick-pivot
MIT License
64 stars 21 forks source link

Totals functionality #53

Closed turnerniles closed 7 years ago

turnerniles commented 7 years ago

QuickPivot should return row and column totals and have the option to turn them on/off. Should this be done in the quickpivot logic or can it be done in a custom aggregator?

pat310 commented 7 years ago

@turnerniles We'll do this in the quick-pivot. We could add another row to the "table" that is returned, the row would be of type: 'sum'.

Should this just be a count or summation, or should it use whatever the user puts in? Do we also want to add a column for aggregation over the columns like the request https://github.com/turnerniles/react-virtualized-pivot/issues/100?

turnerniles commented 7 years ago

@pat310 We probably need to add both row and column total support but could start with row totals. As you mentioned I agree the aggregator selected or provided should be run over all the results in the row/column sum/count/min/max so the sum/count/min/max of that row/column is returned. I don't think we need an additional custom function at least for now.