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


   @sahildoshi013 unfortunately it's not yet possible to apply this logic per 
metric. However, in the meantime, you can create a secondary metric where you 
apply a window function where you divide your aggregate expression with the 
total for that row (feel free to customize the window function to your use 
case):
   1. First metric: `COUNT(*)`
   2. Second metric: `1.0 * COUNT(*) / SUM(COUNT(*)) OVER ()`
   
   <img width="644" alt="image" 
src="https://user-images.githubusercontent.com/33317356/156127975-a54f1efe-a573-44eb-ba66-b3f8b716e7ed.png";>


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to