apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
62.37k stars 13.7k forks source link

[Bug 0.37.2 Pivot Table] Pivot table not work correctly with Sum Total - Version 0.37.2 #11298

Closed justinphamvn closed 3 years ago

justinphamvn commented 4 years ago

Pivot table not work correctly with Sum Total I have a Pivot Table with:

Distributor Code / Sum of Quantity / Sum of Amount 2000006 / 31,637 / 468,966,500 2000013 / 28,826 / 238,210,000

Expected results

Sum Total work correctly Total Quantity: 60,463 Total Amount: 707,176,500

Actual results

Sum Total not work correctly Total Quantity: 31,637 (It's only calculate with MAX instead SUM function) Total Amount: 468,966,000 ( Max and Auto Rounding !!! )

Screenshots

Superset_PivotTable_issues

Environment

issue-label-bot[bot] commented 4 years ago

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.97. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

junlincc commented 4 years ago

thanks for reporting @justinphamvn justinphamvn

It looks like there are more issues around the pivot table besides sorting and icons......

https://github.com/apache/incubator-superset/issues/11268 https://github.com/apache/incubator-superset/issues/11250 https://github.com/apache/incubator-superset/issues/10737

@villebro

villebro commented 4 years ago

@justinphamvn are you sure your columns are numeric? This is what I'm getting on current master (I didn't test on 0.37.2, but I suspect the behavior to be the same): image

justinphamvn commented 4 years ago

@justinphamvn are you sure your columns are numeric? This is what I'm getting on current master (I didn't test on 0.37.2, but I suspect the behavior to be the same): image

Hi @villebro Yes, it is definitely a numeric type because before upgrade to 0.37.2 It work very well on 0.37.0 version

Superset_PivotTable

junlincc commented 4 years ago

@justinphamvn this issue should have been fixed in master, can you double check? thanks !

magic-overflow commented 3 years ago

image Version 0.38.0

korridor commented 3 years ago

I am also still having the same problem with version 0.38.0. @junlincc Can you please reference the pull request or commit that fixed that problem. Maybe I can look into that in more detail with that information.

ErinYener commented 3 years ago

I am having this same issue on version 0.37.2; any updates would be appreciated!

korridor commented 3 years ago

I think somebody else (@kakoni) created an issue for the same problem here: #11658

djouallah commented 3 years ago

I have the same problem, the total of division is wrong image

EikotheRookie commented 2 years ago

I have the same problem, the subtotal and the total of division is wrong. I'm using Pivot Table v2 under apache-superset version 1.3.2.

superset_issue

rumbin commented 2 years ago

@EikotheRookie: In my understanding, the progress column, which ist the division of the previous two columns, is a SQL metric rather than a post-processed value?! In that case, Superset cannot know about the fact that this is a division and how to correctly summarize this metric. There is no way to correctly summarize just this progress column alone.

Or am I misunderstanding the problem?

EikotheRookie commented 2 years ago

Yes,you got it.

In TABLE VIZ we can get a correct (total of actual)/ (total of buget). But there is no way to add (sutotal of actual)/ (total of buget) for each group. superset_issue_2

In Pivot Table v2 , I can show both the Subtotal and Total row as i wish. But the result of (total of actual)/ (total of buget) and (subtotal of actual)/ (subtotal of buget) is a wrong number.

So Is there anyway to calculate a right divison of (total of actual)/ (total of buget)?

jgarcia-74 commented 2 years ago

Is there a way we could specify the aggregtion function per column, instead of using the same aggregation across the different metrics? I have a combination of columns which are sales and margins, for examples. So, I would like to use the sum aggregation for the sales metrics and the average aggregation for the margins. (Now, this wouldn't solve the issue that was discribed, where the total sales/total cost would be needed to get the accurate percentage). Is there a way to do this? I was able to modify the regular table chart, to include the hierarchy drilling, and the ability to specify the aggregation by column, however, there are some features from the pivottable that we would like to use. How difficult would this be to accomplish?