NavidCopy of Untitled Query
    Updated 2022-12-09
    with tpm as (
    select
    date_trunc('minute', block_timestamp) as mnt,
    event_type,
    count(distinct tx_id) as tx_cnt
    from
    flow.core.fact_events
    where
    TX_SUCCEEDED and block_timestamp > '2022-01-01'
    group by 1, 2
    )
    select
    date_trunc('month', mnt) as mont,
    event_type,
    avg(tx_cnt) as avtx,
    avg(avtx) over (partition by event_type order by mont asc rows between 14 preceding and current row) as moving_avg_tx_cnt
    from
    tpm
    group by 1, 2
    having avtx > 5
    order by 1 asc
    Run a query to Download Data