Custom Aggregate Functions in Data Table Component #2491
nickfanion
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
On Slack, Sean pointed out to me that setting |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
I think the Data Table component needs the option to specify custom aggregation functions or formulas to display accurate total and subtotal rows.
What problem would this solve?
Without the ability to specify a custom aggregation function, some aggregations cannot be calculated accurately. For example, take percent change:
( new_value - old_value ) / old_value
I have a data table with four columns:
The aggregate in the total row correctly sums the sales and sales_year_ago columns, but none of the existing aggregation functions correctly display sales_yoy_percent_chg. The sales and sales_year_ago columns need to be aggregated with sum first, and then the calculation above applied. Applying a mean or weighted mean aggregation to the product percent change values does not yield the correct result.
EDIT: I forgot to add that custom aggregation values is a solution for tables with a single total row, but does not work for the unique aggregations necessary in a groupBy subtotal.
How should it work?
No response
Beta Was this translation helpful? Give feedback.
All reactions