walemathsNew User Activities Tracker
Updated 2024-08-07
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
›
⌄
-- forked from Masi / New Per Label Type @ https://flipsidecrypto.xyz/Masi/q/dO4HqGdChO8M/new-per-label-type
with tb1 as ( select block_timestamp,
LABEL_TYPE,
project_name,
tx_signer as user
from near.core.fact_transactions a join near.core.dim_address_labels b on a.tx_receiver = b.address
where TX_SUCCEEDED = 'true'
UNION
select block_timestamp,
label_type,
project_name,
tx_receiver as user
from near.core.fact_transactions a join near.core.dim_address_labels b on a.tx_signer = b.address
where TX_SUCCEEDED = 'true'
)
,
tb2 as ( select min(block_timestamp) as min,
min(label_type) as min_label,
user
from tb1
group by 3)
select trunc(min,'month') as monthly,
min_label as label,
count(DISTINCT user) as new_users
from tb2
where min::date >= '2023-01-01'
group by 1,2
QueryRunArchived: QueryRun has been archived