rusackas opened a new issue, #42809:
URL: https://github.com/apache/superset/issues/42809

   ### Description
   
   apache/superset#42761 reintroduced the pivot table's "Show values as" 
percent display (% of row/column/grand total) as a client-side render 
transform. Confirmed via code search: `showValuesAs` only flows into 
`transformProps.ts` for the React render path 
(`PivotTableChart.tsx`/`react-pivottable/utilities.ts`). The backend pandas 
postprocessing pivot operator (`superset/utils/pandas_postprocessing/pivot.py`, 
used for CSV/XLSX exports and scheduled report rendering, which run server-side 
without a browser) has no concept of `showValuesAs` at all.
   
   Net effect: a pivot table chart configured to show percentages in 
Explore/dashboards will still export and report actual (non-percentage) values 
via CSV, XLSX, and scheduled alerts/reports.
   
   ### How to reproduce
   
   1. Create a Pivot Table v2 chart, set "Show values as" to "% of Total".
   2. Confirm Explore renders percentages.
   3. Download as CSV/XLSX, or view the chart via a scheduled report/alert.
   4. Observe: exported/reported values are the raw metric values, not 
percentages.
   
   ### Why this is more than a quick fix
   
   The interactive render path gets its percent denominators from multiple SQL 
rollup-level queries (`GROUPING SETS` or one query per level) that the 
export/report query path doesn't currently issue in the same shape, so 
replicating the percent computation in `pivot.py` needs either:
   - teaching the export/report query-building path to request the same rollup 
levels, or
   - computing row/column/grand totals a different way inside the pandas 
postprocessing step.
   
   Either approach is a real design decision, not a one-line fix, so this is 
filed as a tracked gap rather than bundled into a quick patch.
   
   ### Related
   
   - apache/superset#42761 (introduced the feature)


-- 
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