Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

[table] Total Row for Table Charts v2(in comment) #12907

Closed
rwspielman opened this issue Feb 3, 2021 · 6 comments
Closed

[table] Total Row for Table Charts v2(in comment) #12907

rwspielman opened this issue Feb 3, 2021 · 6 comments
Labels
enhancement:request Enhancement request submitted by anyone from the community viz:charts:table Related to the Table chart

Comments

@rwspielman
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Table charts don't include an option for 'Total' when utilizing group by. There is the option to do this in pivot tables, however, the 'All' record just floats around and isn't really useful to quickly glance at from the user's POV.

Describe the solution you'd like
A toggle option on table charts that lets the user include a total row. Ideally, the total row will stick to the bottom of the table and be stylized differently than the rest of the table.

Describe alternatives you've considered
We tried using the pivot table with the option for a total row - but because it is named 'All' if we sort by the groupby in alphabetical, it will just float in the midst of all the data.

@rwspielman rwspielman changed the title Total Row for Table Charts [table] Total Row for Table Charts Feb 3, 2021
@zhaoyongjie zhaoyongjie added viz:charts:table Related to the Table chart enhancement:request Enhancement request submitted by anyone from the community labels Feb 3, 2021
@junlincc junlincc added the need:design-review Requires input/approval from a Designer label Feb 4, 2021
@Steejay
Copy link

Steejay commented Feb 4, 2021

@junlincc what does 'All' show in this context? Doesn't seem like it is displaying the sum of numbers in the result being displayed.

Screen Shot 2021-02-04 at 1 50 46 PM

cc @mihir174

@junlincc
Copy link
Member

junlincc commented Feb 4, 2021

Screen Shot 2021-02-04 at 2 06 18 PM

@rwspielman Thanks for requesting. this has been on our radar.

@Steejay I think what Rob meant was adding a row at the bottom of the table to sum numbers in each column. something like this in tableau.
image

the challenge for Design here is one -> when there's pagination(large amount of rows), how do we define which is the "last row" . does user need to flip to the last page to view total? or can we truncate from middle, display only one page, when user switch to the Sum mode.
two, where to add this switch?

@Steejay @mihir174

@rwspielman
Copy link
Contributor Author

Junlin (@junlincc), confirming that your second screenshot is the end result I'm looking for. We are coming from excel reporting mostly so the parallel in excel looks like this:
Screen Shot 2021-02-05 at 1 04 40 AM

To opine on your second design consideration of where to add the switch, I think that for the case of Query Mode: Aggregate it should be placed in the Group By section of the control panel. From a user standpoint, it would be like unioning an additional row where we are grouping by True (i.e. SELECT "Grand Total" as <groupby>, <metrics> FROM <table> GROUP BY True ...)

Additionally, our use case is for table viz Query Mode: Aggregate. For this case, it should carry over the metrics defined in the query section of the control panel and not require the user to define an aggregating function.

@villebro
Copy link
Member

villebro commented Feb 5, 2021

@rwspielman now that it has been migrated the table chart to the new chart data endpoint (see #10270), it is finally possible to add a total row to the table chart. The reason this wasn't possible before is because legacy charts were really only able to do single query requests, making it difficult to get both row level data and aggregates for the whole dataset. With the new architecture, it's possible to issue multiple queries to the backend for a single chart rendering. In practice this feature would require issuing a second query to the analytical database, where the groupings have been removed, and only the metrics are present.

@amitmiran137 I know your team has been thinking about working on this functionality. Have you considered how pagination would be taken into account when displaying results? I personally think think

  • The total should display the value for all metrics without grouping: if a metric is AVG(x), the total row would display the average for the whole column.
  • In addition to showing the aggregate metric values, it would also show total row count.
  • The total row would be visible all the time, showing results for ALL rows, not only those visible in the current pagination view.

@korpa
Copy link

korpa commented Feb 9, 2021

I would have 2 wishes if you start to work on this:

  • Make total lines position configurable: top or bottom
  • Make total columns position configurable: beginning or end

This could be very handy if you have many lines or many rows

@junlincc
Copy link
Member

the enhancement @korpa mentioned is scheduled for H2 22, but we can provide design support to anyone who wants to work on the implementation sooner. :)

@junlincc junlincc changed the title [table] Total Row for Table Charts [table] Total Row for Table Charts v2(in comment) Nov 11, 2021
@junlincc junlincc removed the need:design-review Requires input/approval from a Designer label Nov 11, 2021
@apache apache locked and limited conversation to collaborators Feb 2, 2022
@geido geido converted this issue into discussion #18432 Feb 2, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
enhancement:request Enhancement request submitted by anyone from the community viz:charts:table Related to the Table chart
Projects
None yet
Development

No branches or pull requests

6 participants