mz0111near 4
    Updated 2023-06-26
    WITH TAB1 AS
    (select
    count(distinct tx_signer) as users,
    project_name as pro
    from near.core.fact_transactions
    LEFT JOIN near.core.dim_address_labels
    on address = TX_RECEIVER
    where block_timestamp >= current_date - 7
    and LABEL_TYPE = '{{label_types}}'
    group by 2
    having users > 35
    ),

    TAB2 AS
    (select
    date_trunc('month',block_timestamp) as date,
    tx_signer,
    tx_receiver,
    tx_hash as hash,
    project_name
    from near.core.fact_transactions
    LEFT JOIN near.core.dim_address_labels
    on address = TX_RECEIVER
    where block_timestamp >= '{{Begining_Time}}'
    and project_name in (select pro from tab1)
    and LABEL_TYPE = '{{label_types}}'
    )
    select
    date,
    project_name,
    count(distinct hash) as txs,
    count(distinct tx_signer) as users
    from TAB2
    where project_name is not null
    group by 1 , 2
    Run a query to Download Data