infinite-react icon indicating copy to clipboard operation
infinite-react copied to clipboard

Pivot Total Column is not displayed when only one pivot column

Open vitolpoc opened this issue 4 years ago • 4 comments

When configuring only one pivot and the pivotTotalColumnPosition, the total column is not displayed.

sandbox: https://codesandbox.io/s/infinite-table-pivot-total-column-for-one-level-m3ioz?file=/src/App.tsx

Version: 0.0.8 Actual Result: Total column is not displayed Expected Result: Total column should be displayed if configured with "start" or "end" value

vitolpoc avatar Dec 22 '21 13:12 vitolpoc

This was intentionally implemented like this, as there are no column groups and only one pivot available. Screenshot 2022-01-03 at 12 13 14

We can revisit this if you think it would be useful to allow a totals column in this case - our initial thinking was that you don't have column groups generated, so no need for a totals column to aggregate the column group.

roblotter avatar Jan 03 '22 10:01 roblotter

In the screenshot above, we cannot have the aggregation (let's say the average) for the whole TypeScript row then.

The fact that the column represents a pivot means it's a group of values, so it makes sense to be able to configure the whole aggregation for this group like if it was in another column group IMO.

vitolpoc avatar Jan 05 '22 16:01 vitolpoc

So basically you want a grand total column, correct?

Something like Screenshot 2022-01-06 at 13 36 51 (source)

(ignore for now the "Grand Total" row - that will probably also come in the future)

What's nice would also be the ability to have multiple aggregations - I think this is what you mean by #19 , am I right?

Let us know if our assumptions are correct, so we can start on the implementation

roblotter avatar Jan 06 '22 11:01 roblotter

yes your assumptions are correct. Like we could have a total row, we could have a total column (when using pivot).

Indeed #19 refers to multiple aggregations.

vitolpoc avatar Jan 06 '22 12:01 vitolpoc