rusackas commented on issue #25747:
URL: https://github.com/apache/superset/issues/25747#issuecomment-4738469860

   Doing some triage housekeeping here. There's a whole constellation of issues 
describing the same underlying thing: totals/subtotals re-aggregate the 
already-aggregated cell values, which is just wrong for any non-additive metric 
(ratios, `AVG`, `COUNT_DISTINCT`, percentiles...). Going to make this the 
canonical thread, since it's the oldest and most active, and it's what #34592 
already targets.
   
   Folding these in, with the net-new context from each:
   - #38674 - same thing on the pivot Grand Total, nicely framed as a ratio 
metric `SUM(num)/NULLIF(SUM(den),0)`. Also confirmed there's no 
`ENABLE_BACKEND_PIVOT_TOTALS` flag (that was a red herring), and totals get 
processed in `superset/charts/client_processing.py`.
   - #32260 - the completion-percentage example, plus a few folks floating an 
Excel-style in-cell/formula approach (a configurable `round((a/b)*100, 2)` kind 
of thing) as one possible direction.
   - #37627 - the important one: this is the **Table** chart, not pivot, and it 
still repros on 6.0.0 (percentage column shows zeros when "Show summary" is 
on). So the bug lives in the `plugin-chart-table` path too.
   - #34350 / #34425 / #34426 - Table chart percentage totals on 4.1.3. #34425 
adds the wrinkle that paginated percentage calcs only use the current page 
unless you set "Percentage metric calculation" to "All records".
   
   So the scope here is explicitly **both pivot tables and regular table 
charts** - any real fix needs to cover both code paths. #34592 only handles the 
pivot side at the moment, FWIW.
   
   Design discussion lives in #29297, and the open question there is still the 
gate: do we fire a query per aggregation level (#34592's approach, with perf 
tradeoffs) or go formula-aware? Would love eyes from folks who've been in this 
code... CC @michael-s-molina @mistercrunch @villebro
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to