Query editor
WITH tx_data AS (SELECTDATE_TRUNC('month', block_time) AS month,amount_usdFROM query_5365290WHERE amount_usd > 0)SELECTmonth,ROUND(100.0 * SUM(CASE WHEN amount_usd < 5 THEN 1 ELSE 0 END) / COUNT(*), 1) AS "< $5",ROUND(100.0 * SUM(CASE WHEN amount_usd >= 5 AND amount_usd < 10 THEN 1 ELSE 0 END) / COUNT(*), 1) AS "$5-10",ROUND(100.0 * SUM(CASE WHEN amount_usd >= 10 AND amount_usd < 25 THEN 1 ELSE 0 END) / COUNT(*), 1) AS "$10-25",ROUND(100.0 * SUM(CASE WHEN amount_usd >= 25 AND amount_usd < 50 THEN 1 ELSE 0 END) / COUNT(*), 1) AS "$25-50",ROUND(100.0 * SUM(CASE WHEN amount_usd >= 50 AND amount_usd < 100 THEN 1 ELSE 0 END) / COUNT(*), 1) AS "$50-100",ROUND(100.0 * SUM(CASE WHEN amount_usd >= 100 AND amount_usd < 250 THEN 1 ELSE 0 END) / COUNT(*), 1) AS "$100-250",ROUND(100.0 * SUM(CASE WHEN amount_usd >= 250 AND amount_usd < 500 THEN 1 ELSE 0 END) / COUNT(*), 1) AS "$250-500",ROUND(100.0 * SUM(CASE WHEN amount_usd >= 500 THEN 1 ELSE 0 END) / COUNT(*), 1) AS "$500+",COUNT(*) AS total_txns,ROUND(AVG(amount_usd), 2) AS avg_tx_usd,ROUND(APPROX_PERCENTILE(amount_usd, 0.5), 2) AS median_tx_usdFROM tx_dataGROUP BY 1ORDER BY 1