superset icon indicating copy to clipboard operation
superset copied to clipboard

Pivot Table v2, can't show subtotals based on a single column

Open RavazziniAndrea opened this issue 3 years ago • 4 comments

In the example shown in the picture, I'm extracting prices (column 'Importo') and a delta %. When showing subtotals, I need the sum of prices, but when selecting SUM as aggregate function, it calculates even the sum of the delta, that doesn't make sense.

Is it possible to aggregate on a single column? Even leaving other values empty and showing only the one associated to the aggregate function

Screenshots

image

RavazziniAndrea avatar May 16 '22 11:05 RavazziniAndrea

Trying to make sure I understand the issue/request. It looks like the subtotals are indeed summing/aggregating the values correctly. However, while it's GOOD that you're getting a SUM of the pricing, it's BAD that you're getting a SUM of the delta, and you'd... rather not show that aggregation? Trying to get a sense of what you DO expect to see in that red box, and how you would expect the plugin/controls to support that.

rusackas avatar May 18 '22 14:05 rusackas

Yes, it's how you said. The sum of pricing is good and the sum of the delta doesn't make sense.. In my opinion, if there was the possibility to aggregate on a single set of column (in this case the sum of pricing), the other columns in the subtotal can even be left empty. In my case specifically, the red box can be left empty because the value that I have to see in the subtotal is the sum of prices.

Thanks for the response!

RavazziniAndrea avatar May 18 '22 16:05 RavazziniAndrea

Hmmm... to do what you ask here would mean either building a dynamic control panel section with display options for each metric you've added (kind of like the "Customize Columns section of the Table controls, pictured below), or additional (chart-specific) options for each item in the Metrics control. I don't think we have plans to do either right now, bur if you're passionate about this, you might want to look at how the Table controls are built and consider opening a PR based on that if you're interested in contributing to the codebase.

image

rusackas avatar May 19 '22 20:05 rusackas

Even I would like to have this feature in superset!

moksh-enf avatar Jul 29 '22 21:07 moksh-enf

I support this issue. The same problem - I don't need total sum where there is % sign in metric column and there isn't possibility to cancel total sum for specific columns. However, for column as shipment or plan (without % sign) it's ok to sum each month result for annual total.

Addition: is it possible to bold pivot table borders? maybe is there issue on this topic? Thanks Screenshot_20231114_104709

AdalvP avatar Nov 14 '23 08:11 AdalvP