tkvresearch2024-06-25 11:05 AM
Updated 2024-07-03
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
36
›
⌄
with full_table AS
(select BLOCK_TIMESTAMP as datetime,
tx_hash,
address,
case
when BLOCK_TIMESTAMP = min(BLOCK_TIMESTAMP) over (partition by address order by BLOCK_TIMESTAMP) then 1
else 0
end as flag
from
(select BLOCK_TIMESTAMP,
TX_HASH,
FROM_ADDRESS as address
from blast.core.fact_transactions
where status = 'SUCCESS'
union all
select BLOCK_TIMESTAMP,
TX_HASH,
FROM_ADDRESS
from blast.core.fact_transactions
where status = 'SUCCESS'))
select *
from
(select date,
tx_cnt,
cum_tx_cnt,
(cum_tx_cnt/lag(cum_tx_cnt,7) over (order by date)-1)*100 as change_tx_7d,
(cum_tx_cnt/lag(cum_tx_cnt,30) over (order by date)-1)*100 as change_tx_30d,
user_cnt,
cum_user_cnt,
(cum_user_cnt/lag(cum_user_cnt,7) over (order by date)-1)*100 as change_user_7d,
(cum_user_cnt/lag(cum_user_cnt,30) over (order by date)-1)*100 as change_user_30d,
new_user,
returning_user
from
(select date,
QueryRunArchived: QueryRun has been archived