Query editor
WITH weekly_transactions AS (SELECTDATE_TRUNC('week', block_time) AS week,COUNT(DISTINCT hash) AS total_transactions,DATE_TRUNC('quarter', block_time) AS quarterFROMviction.transactionsWHEREEXTRACT(YEAR FROM block_time) = 2024AND success = trueGROUP BYDATE_TRUNC('week', block_time), DATE_TRUNC('quarter', block_time))SELECTweek,SUM(CASE WHEN quarter = TIMESTAMP '2024-01-01' THEN total_transactions END) AS "q1 transactions",SUM(CASE WHEN quarter = TIMESTAMP '2024-04-01' THEN total_transactions END) AS "q2 transactions",SUM(CASE WHEN quarter = TIMESTAMP '2024-07-01' THEN total_transactions END) AS "q3 transactions",SUM(CASE WHEN quarter = TIMESTAMP '2024-10-01' THEN total_transactions END) AS "q4 transactions"FROMweekly_transactionsGROUP BYweekORDER BYweek;