Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aggregate by row possible? #9

Open
navjeetc opened this issue Aug 26, 2019 · 3 comments
Open

aggregate by row possible? #9

navjeetc opened this issue Aug 26, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@navjeetc
Copy link

navjeetc commented Aug 26, 2019

Is it possible to show aggregated numbers when you have two values in rows. e.g. if the rows have occupation (Doctor, Engineer) and Person Name, can I get total number of people in each occupation. Right now with reducer impl of reducer: (sum, item) => sum + 1, it displays like

blank header blank header blank header
John Doe 1
Engineer John Smith 1
Mike Smith 1
Doctor John Paul 1
Mike Paul 1

But I want to also display total number for Engineer - 3 and and Doctor - 2

@antoinematyja
Copy link
Contributor

antoinematyja commented Oct 13, 2019

In your example, totals by Occupation can be displayed by removing the Person Name column, but it implies changing the columns settings, and you want to have the 2 numbers at the same time.

We could imagine adding a boolean to the Occupation column settings, something like displayTotal which would add a row for each Occupation with its total.

In the case of the demo of this app (country/gender/year), with displayTotal on "country" this would give this :
image

Quite a headache to build colspans/rowspans but it seems possible. But it's a lot of work, and this is not my top priority.

@antoinematyja antoinematyja added the enhancement New feature or request label Oct 13, 2019
@rczupa
Copy link

rczupa commented Mar 16, 2020

Hi Antoinematyja how are you ? Can I fork your project to increase new features ? I need the possibility to use more than one different algoritm of aggregators and this totalizer discussed in here.

After that, if you want, we can merge the solution.

Thanks.

@antoinematyja
Copy link
Contributor

Hi 🙂 Sure.

I'm currently working on new features to add more customization to the headers.
The API for the PivotTable component will change a bit (especially the fields definition), but it should not be incompatible with the features you want to work on.

Thanks for your interest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants