Query editor
WITH tx_data AS (SELECTDATE_TRUNC('month', block_time) AS month,sender,SUM(amount_usd) AS user_monthly_spend,COUNT(*) AS user_monthly_txnsFROM query_5365290WHERE amount_usd > 0GROUP BY 1, 2)SELECTmonth,COUNT(DISTINCT sender) AS active_users,ROUND(AVG(user_monthly_spend), 2) AS avg_spend_per_user,ROUND(APPROX_PERCENTILE(user_monthly_spend, 0.5), 2) AS median_spend_per_user,ROUND(AVG(user_monthly_txns), 2) AS avg_txns_per_user,ROUND(APPROX_PERCENTILE(user_monthly_txns, 0.5), 2) AS median_txns_per_user,ROUND(SUM(user_monthly_spend), 2) AS total_volume_usd,ROUND(SUM(user_monthly_spend) / NULLIF(LAG(SUM(user_monthly_spend)) OVER (ORDER BY month), 0) - 1, 3) AS volume_mom_changeFROM tx_dataGROUP BY 1ORDER BY 1