SocioAnalyticatotal new user
    Updated 2024-02-07
    with all_user as (
    SELECT
    block_timestamp,
    tx_hash,
    tx_receiver,
    tx_signer,
    row_number() over (partition by tx_signer order by block_timestamp) as rank
    FROM near.core.fact_transactions
    WHERE TX_SUCCEEDED
    )
    ,
    active_users_q1 as (
    SELECT
    count(DISTINCT tx_signer) as "Q1 2023"
    FROM all_user a
    LEFT JOIN near.core.dim_address_labels b
    on a.tx_RECEIVER = b.address
    WHERE block_timestamp BETWEEN '2023-01-01' AND '2023-04-01'
    AND project_name is not null
    AND rank = 1
    )
    ,
    active_users_q2 as (
    SELECT
    count(DISTINCT tx_signer) as "Q2 2023"
    FROM all_user a
    LEFT JOIN near.core.dim_address_labels b
    on a.tx_RECEIVER = b.address
    WHERE block_timestamp BETWEEN '2023-04-01' and '2023-07-01'
    AND project_name is not null
    AND rank = 1
    )
    ,
    active_users_q3 as (
    SELECT
    count(DISTINCT tx_signer) as "Q3 2023"
    Last run: about 1 year ago
    New.U Q1 2023
    New.U Q2 2023
    New.U Q3 2023
    New.U Q4 2023
    Total New Users 2023
    % New users Q4 2023
    1
    6801825860332735771141755701817755678
    1
    46B
    497s