Updated 2022-12-07
    -- this code is thankfully burrowed from 0xHaM☰d: https://app.flipsidecrypto.com/dashboard/5hamvc
    with pricTb as (
    select
    timestamp::date as p_date,
    avg(price_usd) as usdprice
    from flow.core.fact_prices
    where symbol = 'FLOW'
    and source = 'coinmarketcap'
    group by 1
    )
    , laligaTb as (
    select
    BLOCK_TIMESTAMP::date as date,
    row_number () over (order by date) as day_rank,
    'LaLiga Golazos' as collection,
    buyer,
    COUNT(DISTINCT tx_id) as sales_cnt,
    sum(case when currency = 'A.1654653399040a61.FlowToken' then price*usdprice else price end) as volume
    from flow.core.ez_nft_sales s join pricTb p on s.block_timestamp::Date = p.p_date
    where nft_collection in ('A.87ca73a41bb50ad5.Golazos')
    and tx_succeeded = 'TRUE'
    GROUP by 1,3,4
    qualify day_rank <= 7
    -- ORDER by 1 ASC
    -- limit 30
    )
    , TopShotTb as (
    select
    BLOCK_TIMESTAMP::date as day,
    row_number () over (order by day) as d_rank,
    'TopShot' as collection,
    s.buyer,
    COUNT(DISTINCT tx_id) as sales_cnt,
    sum(case when currency = 'A.1654653399040a61.FlowToken' then price*usdprice else price end) as volume
    from flow.core.ez_nft_sales s join pricTb p on s.block_timestamp::Date = p.p_date
    JOIN laligaTb c on s.buyer = c.buyer
    Run a query to Download Data