superset icon indicating copy to clipboard operation
superset copied to clipboard

Pivot table summary returning wrong results

Open djouallah opened this issue 4 years ago • 13 comments

I am using Preset Cloud, so not sure which version is used, as far as I can see Pivot table summary generate only 1 SQL Query, I would expect that it generate two.

  • one for the rows
  • another for the summary

see the results of the division which is wrong Actual/ Budget, I don't know how to tell superset to keep the same metric definition for the summary rows image

djouallah avatar Oct 04 '21 06:10 djouallah

+1

grafke avatar Nov 16 '21 15:11 grafke

I'm not so sure this is a common use case. The Total (Sum) row is just that, a sum of the values in the column. By that definition, this chart is quite correct. If you want to use these totals formulaically against each other, that seems like it would be adding spreadsheet functionality that goes beyond the typical scope of a pivot table. @kgabryje @villebro curious your thoughts on this, if they differ.

rusackas avatar Nov 22 '21 06:11 rusackas

yes, it is the default expectation how the measure works in any BI tools, I expect the summary row to respect the measure definition not doing a sum, if I want a sum, then I create a measure that explicitly say, for a summary row do a sum of a column

djouallah avatar Nov 22 '21 10:11 djouallah

@djouallah Correct me if I'm wrong but the problem is the summing of the percentages in the Progress column in the Total (sum) row, right? This should be a weighted percentage. Summing percentages is useless.

robjuffermans avatar Nov 22 '21 10:11 robjuffermans

@robjuffermans what I am saying having an option to do a sum in the first place is a wrong, I expect the summary row to respect the metric definition , that pretty much how any BI tools works (Tableau, PowerBI, Google Data Studio etc)

djouallah avatar Nov 22 '21 10:11 djouallah

something like this see the percentage works at all level even in the summary rows image

djouallah avatar Nov 22 '21 10:11 djouallah

exactly, that's what I'm missing also. @rusackas this should be regarded normal functionality for a pivot table from my point of view.

robjuffermans avatar Nov 22 '21 10:11 robjuffermans

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

stale[bot] avatar Apr 17 '22 21:04 stale[bot]

CC @lauderbaugh and @yousoph in case you know how we can revisit this (and related issues) holistically. Adding @kgabryje since he's a SME on the implementation

rusackas avatar Jan 18 '23 22:01 rusackas

@djouallah Did you find any workarounds already. I could imagine to build a chart per aggregation level but it feels far from perfect.

Ideally one can fold/unfold on all the dimension and (sub)totals should always respect the formula behind the metric instead of creating a sum of the metric results.

mtthsbrr avatar Sep 27 '23 09:09 mtthsbrr

@mtthsbrr nope, just gave up

djouallah avatar Sep 27 '23 09:09 djouallah

+1

wkolbnik avatar Nov 13 '23 21:11 wkolbnik

+1

jjlabuda avatar Apr 04 '24 10:04 jjlabuda

There are quite a few issues around this, which I'm trying to consolidate. I'll close this issue in favor of another that sums it up fairly concisely: https://github.com/apache/superset/issues/25747

rusackas avatar Jun 03 '24 16:06 rusackas