tomilayoperfect-gray
Updated 2024-10-29
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
26
27
28
›
⌄
WITH weekly_summary AS (
SELECT
DATE_TRUNC('week', block_timestamp) AS week_start_date,
COUNT(DISTINCT tx_hash) AS transactions_per_week
FROM
blast.core.fact_transactions
WHERE
block_timestamp BETWEEN '2024-01-01' AND '2024-07-31'
GROUP BY
DATE_TRUNC('week', block_timestamp)
),
accumulated_transactions AS (
SELECT
week_start_date,
transactions_per_week,
SUM(transactions_per_week) OVER (ORDER BY week_start_date) AS total_transactions_to_date
FROM
weekly_summary
)
SELECT
week_start_date AS week,
transactions_per_week AS weekly_transaction_count,
total_transactions_to_date AS cumulative_transaction_count
FROM
accumulated_transactions
ORDER BY
week_start_date;
QueryRunArchived: QueryRun has been archived