SocioAnalyticaactive user
    Updated 2024-01-03
    with all_user as (
    SELECT
    block_timestamp,
    tx_hash,
    to_address,
    from_address,
    row_number() over (partition by from_address order by block_timestamp) as rank
    FROM avalanche.core.fact_transactions
    WHERE STATUS = 'SUCCESS'
    )
    ,
    active_users_q1 as (
    SELECT
    project_name,
    count(DISTINCT from_address) as "Q1 2023"
    FROM all_user a
    LEFT JOIN avalanche.core.dim_labels b
    on a.to_address = b.address
    WHERE block_timestamp BETWEEN '2023-01-01' AND '2023-04-01'
    AND project_name is not null
    AND label_type not in ('token', 'chadmin')
    GROUP by 1
    )
    ,
    active_users_q2 as (
    SELECT
    project_name,
    count(DISTINCT from_address) as "Q2 2023"
    FROM all_user a
    LEFT JOIN avalanche.core.dim_labels b
    on a.to_address = b.address
    WHERE block_timestamp BETWEEN '2023-04-01' and '2023-07-01'
    AND project_name is not null
    AND label_type not in ('token', 'chadmin')
    GROUP by 1
    )
    QueryRunArchived: QueryRun has been archived