GitHub user swheeler7 created a discussion: Pivot Table V2 Improvements

Hi all,

One limitation to the the current pivot table v2 is that the pivot table 
"options" apply to each metric added to the pivot table. I often want to use 
the pivot table to show the count and frequency distribution for each 
combination of categories. In google sheets I can create a pivot table with 
both frequencies and counts that looks like this:

<img width="707" height="156" alt="image" 
src="https://github.com/user-attachments/assets/73b06a03-e9e0-4f36-9c16-cf2aff099721";
 />

The key is that in google sheets I can add two "Count" metrics and have the 
first show the counts and have the second show the count as a fraction of the 
row total. In superset we are able to use aggregations functions on the cells 
to show the sum as a fraction of rows, however this aggregation function 
applies to every single metric that is added so there is no way to have one 
metric show counts, and another that shows these counts as a fraction of the 
row total. So to get the same information from a pivot table in superset I 
would need to create two seperate pivot tables and it would look like this:

<img width="411" height="285" alt="image" 
src="https://github.com/user-attachments/assets/afd3ce84-c12b-4b4a-9f9a-ae8bec483d65";
 />

My current workaround is to not use the pivot table at all and instead I use a 
regular table with custom metrics but this approach is much less ergonomic as I 
have to create a custom expression for each level of the variable that I want 
to use as my pivot table "column" and is prone to errors such as adding a new 
level to the variable upstream in my pipeline. 

I want to propose that the pivot table should be modified so that the 
"Aggregation Function" option is applied per metric and not overall to the 
table as a whole.

GitHub link: https://github.com/apache/superset/discussions/38036

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


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

Reply via email to