abaplay_types holders
    Updated 2022-07-25
    with play_type_hold as (
    select PLAY_TYPE, m.NFT_ID, datediff(day,max(s.BLOCK_TIMESTAMP), CURRENT_DATE) hold_days
    from flow.core.dim_topshot_metadata m
    join flow.core.fact_nft_sales s USING(NFT_ID)
    group by 1,2
    )
    , all_holders as (
    select PLAY_TYPE, count(distinct NFT_ID) number_of_holders
    from play_type_hold
    where hold_days > 0
    group by 1
    )
    , holders_atleast_30_days as (
    select PLAY_TYPE, count(distinct NFT_ID) number_of_holders
    from play_type_hold
    where hold_days >= 30
    group by 1
    )
    , holders_atleast_60_days as (
    select PLAY_TYPE, count(distinct NFT_ID) number_of_holders
    from play_type_hold
    where hold_days >= 60
    group by 1
    )
    , holders_atleast_90_days as (
    select PLAY_TYPE, count(distinct NFT_ID) number_of_holders
    from play_type_hold
    where hold_days >= 90
    group by 1
    )
    select a.PLAY_TYPE,
    a.number_of_holders all_holders,
    th.number_of_holders atleast_30_days,
    s.number_of_holders atleast_60_days,
    n.number_of_holders atleast_90_days
    from all_holders a
    Run a query to Download Data