You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/02/22 09:59:46 UTC

[GitHub] [superset] villebro commented on issue #18836: Charts: Custom Calculated Percentage Metrics not behaving as expected in Tables Chart

villebro commented on issue #18836:
URL: https://github.com/apache/superset/issues/18836#issuecomment-1047620976


   If you want to calculate the proportion of one aggregate over another one, I believe you should use `SUM` rather than `AVG`? In other words, to calculate the total amount of sales in Nort America as a proportion of global sales, I would do `SUM(na_sales)/SUM(global_sales)`, not `AVG(na_sales)/AVG(global_sales)`:
   
   ![image](https://user-images.githubusercontent.com/33317356/155108302-c089db14-27ad-4452-8061-18714e1fde4f.png)
   
   Or am I misunderstanding something?


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org