79814463

Date: 2025-11-08 21:38:43
Score: 1
Natty:
Report link

There is a way to trick GROUPBY to refer to two different value columns. It works by using the function FILTER inside the LAMBDA wrapper and passing not the values, but the row fields grouping column again to LAMBDA. Here is a link to a YouTube video with a detailed explanation what to do and why it works: https://youtu.be/b3Z2Bi5MnOA

In your case, because you first need to sum up the values and then divide the results, you will need to use inside the LAMBDA wrapper the function SUM wrapped around FILTER with first column divided by SUM wrapped around FILTER with second column.

Reasons:
  • Blacklisted phrase (1): youtu.be
  • Whitelisted phrase (-1): In your case
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Nino K.