saeedmznWhen Do Transactions Fail? - rate
Updated 2022-05-31
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
›
⌄
with all_ as (
select
BLOCK_TIMESTAMP::date as date ,
-- case when TX_SUCCEEDED = true then 'SUCCEEDED'
-- when TX_SUCCEEDED = false then 'FAILED'
-- end as status ,
count (DISTINCT tx_id) as num_transactions,
sum (num_transactions) over (order by date ) as growth
from flow.core.fact_transactions
group by 1
),
success as (
select BLOCK_TIMESTAMP::date as date ,
count (DISTINCT tx_id) as success_transactions
from flow.core.fact_transactions
where TX_SUCCEEDED = true
group by 1
)
select
date ,
num_transactions,
(success_transactions/num_transactions)*100 as success_percent,
from all_ join success using (date)
group by 1,2,3
Run a query to Download Data