efer6. Event Types - 2
Updated 2023-04-13
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
›
⌄
WITH result AS (
SELECT
DATE_TRUNC('month', BLOCK_TIMESTAMP) AS date_month,
EVENT_TYPE AS event,
COUNT(*) AS txns
FROM flow.core.fact_events
WHERE BLOCK_TIMESTAMP >= '2022-01-01'
GROUP BY event, date_month
)
select * from (
SELECT
event,
txns,
date_month,
MONTHNAME(date_month),
row_number () over (partition by date_month order by txns desc) rn
FROM result) v
where rn <= {{TOP_n}}
order by date_month, txns desc
Run a query to Download Data