Query editor
WITH monthly_active_users AS (SELECTDATE_TRUNC('month', block_time) AS month, -- Truncate time to monthCOUNT(DISTINCT "from") AS active_users -- Count distinct addresses that signed transactionsFROM flare.transactionsWHERE DATE_TRUNC('month', block_time) >= timestamp '2023-09-01 00:00' --and DATE_TRUNC('month', block_time) < date_trunc('month',current_date)GROUP BY 1),percent_change AS (SELECTmonth,active_users,LAG(active_users) OVER (ORDER BY month) AS prev_active_users, -- Previous month's active users-- Calculate the percentage changeCASEWHEN LAG(active_users) OVER (ORDER BY month) IS NOT NULL THEN((active_users - LAG(active_users) OVER (ORDER BY month)) * 100.0) /LAG(active_users) OVER (ORDER BY month)ELSENULLEND AS pct_changeFROM monthly_active_users)SELECTmonth as "Month",active_users as "Active Users",pct_change as "Growth [%]" -- Percentage change columnFROM percent_changeORDER BY month DESC;