NavidUntitled Query
Updated 2022-12-09Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
›
⌄
with tpm as (
select
date_trunc('minute', block_timestamp) as mnt,
count(distinct tx_id) as tx_cnt,
avg(tx_cnt) over (order by mnt asc) as avg_tx_cnt
from
flow.core.fact_transactions
where
TX_SUCCEEDED --and block_timestamp > CURRENT_DATE-30
group by 1
)
select
date_trunc('week', mnt) as mont,
avg(tx_cnt) as avtx,
avg(avtx) over (order by mont asc rows between 14 preceding and current row) as moving_avg_tx_cnt
from
tpm
group by 1
order by 1 asc
Run a query to Download Data