select
EVENT_TYPE as actions
,count(DISTINCT tx_id) as "Total # of Tx"
,COUNT(DISTINCT CASE WHEN TX_SUCCEEDED = TRUE THEN tx_id END) as "Total # of Succeed Tx Cnt"
from flow.core.fact_events
where block_timestamp::date >= '2022-01-01'
and block_timestamp::date < CURRENT_DATE - 1
group by 1
order by 2 DESC
limit 20