Query editor
--h/t jhackworthWITH mode_users AS (SELECT"from" AS user,MIN(DATE_TRUNC('month', block_time)) AS month_cohort,'mode' AS chainFROM mode.transactionsWHERE successAND DATE(block_time) >= DATE('2023-01-01')GROUP BY 1HAVING MIN(DATE_TRUNC('month', block_time)) >= DATE_TRUNC('month', CURRENT_TIMESTAMP - INTERVAL '12' month)),combined_users AS (SELECT * FROM mode_users)SELECTmonth_cohort,COUNT(DISTINCT user) AS total_usersFROM combined_usersGROUP BY month_cohortORDER BY month_cohort;