Bug description
I am using Apache Superset to build a DataMart with 200+ metrics. When using the Pivot Table, the Grand Total row is performing a simple SUM() of the rows in the frontend (Javascript) instead of re-calculating the metric using the provided SQL expression. This results in incorrect "Partial Sums" for ratios (e.g., $10% + 20% = 30%$ instead of the correct weighted average).
How to Reproduce
Create a metric: SUM(numerator) / NULLIF(SUM(denominator), 0).
Add this metric to a Pivot Table.
Enable "Show Totals".
Observe that the Total row sums the individual row percentages.
Expected Behavior
The Total row should re-execute the metric's SQL formula against the total context (Total Numerator / Total Denominator), similar to how "Partial Sums" work in tools like Qlik.
Actual Behavior
The total is a simple summation of the values displayed in the table rows.
Environment
Superset version: 5.0.0 (or your specific version)
Database: ClickHouse
Feature Flags enabled: ENABLE_BACKEND_PIVOT_TOTALS, GENERIC_CHART_AXES
Screenshots/recordings
No response
Superset version
5.0.0
Python version
3.9
Node version
16
Browser
Chrome
Additional context
I have confirmed that ENABLE_BACKEND_PIVOT_TOTALS = True is set in superset_config.py, but the legacy Pivot Table plugin does not appear to respect this flag.
Checklist
Bug description
I am using Apache Superset to build a DataMart with 200+ metrics. When using the Pivot Table, the Grand Total row is performing a simple SUM() of the rows in the frontend (Javascript) instead of re-calculating the metric using the provided SQL expression. This results in incorrect "Partial Sums" for ratios (e.g.,$10% + 20% = 30%$ instead of the correct weighted average).
How to Reproduce
Create a metric: SUM(numerator) / NULLIF(SUM(denominator), 0).
Add this metric to a Pivot Table.
Enable "Show Totals".
Observe that the Total row sums the individual row percentages.
Expected Behavior
The Total row should re-execute the metric's SQL formula against the total context (Total Numerator / Total Denominator), similar to how "Partial Sums" work in tools like Qlik.
Actual Behavior
The total is a simple summation of the values displayed in the table rows.
Environment
Superset version: 5.0.0 (or your specific version)
Database: ClickHouse
Feature Flags enabled: ENABLE_BACKEND_PIVOT_TOTALS, GENERIC_CHART_AXES
Screenshots/recordings
No response
Superset version
5.0.0
Python version
3.9
Node version
16
Browser
Chrome
Additional context
I have confirmed that ENABLE_BACKEND_PIVOT_TOTALS = True is set in superset_config.py, but the legacy Pivot Table plugin does not appear to respect this flag.
Checklist