I have a legacy SQL query that uses RATIO_TO_REPORT() -- it doesn't use open-access tables, but this is what it looks like:
SELECT
Mutation_AA,
Gene_name,
CaseCount,
RATIO_TO_REPORT(CaseCount) OVER (PARTITION BY Gene_name) AS ratio
FROM (
SELECT
COUNT(DISTINCT ID_tumour, 50000) AS CaseCount,
Mutation_AA,
Gene_name
FROM
[isb-cgc:COSMIC.grch38_v79]
GROUP BY
Mutation_AA,
Gene_name )
I'm trying to migrate from legacy SQL to standard SQL (never having used SQL prior to using BigQuery), so tips would be much appreciated! thx