rajsNew Buyers NFL All Day
    Updated 2022-09-14
    with txs AS
    (
    SELECT
    buyer,
    min(block_timestamp) as date_joined
    from flow.core.ez_nft_sales
    where nft_collection = 'A.e4cf4bdc1751c65d.AllDay'
    group by 1
    )

    SELECT
    date_trunc('day', date_joined) as date,
    case when date_joined::date >= '2022-08-04' and date_joined::date <= '2022-08-28' then 'Pre Season'
    when date_joined::date >= '2022-09-08' then 'Regular Season'
    else 'Others' end as category,
    count(buyer) as no_of_new_buyers,
    avg(count(buyer)) over (order by date_trunc('day', date_joined) rows between 7 preceding and 1 preceding) as "prior_7_days_avg_no_of_new_buyers",
    sum(count(buyer)) over (order by date_trunc('day', date_joined)) as cum_no_of_buyers
    from txs
    group by 1,2
    order by 1

    Run a query to Download Data