adambalaUntitled Query
    Updated 2022-12-05
    -- credit by SOHΞIL

    select
    BLOCK_TIMESTAMP::date as date,
    CASE
    when BLOCK_TIMESTAMP >'2022-11-24' then 'Thanksgiving week'
    else 'normal days'
    end as days,
    count(distinct BUYER) as unique_buyers,
    count(distinct SELLER) as unique_SELLER,
    avg (unique_buyers) over (order by date rows between 7 preceding and current row) as Moving_Average_7_buyers ,
    avg (unique_SELLER) over (order by date rows between 7 preceding and current row) as Moving_Average_7_sellers
    from flow.core.ez_nft_sales
    where NFT_COLLECTION ='A.e4cf4bdc1751c65d.AllDay'
    and currency='A.ead892083b3e2c6c.DapperUtilityCoin'
    and TX_SUCCEEDED ='TRUE'
    and date>='2022-10-01'
    group by 1,2
    Run a query to Download Data