Query editor
SELECTCASEWHEN DATE_PARSE(a.First_Appearance, '%Y-%m') >= DATE_TRUNC('month', CURRENT_DATE - INTERVAL '1' month)AND DATE_PARSE(a.Last_Appearance, '%Y-%m') < DATE_TRUNC('month', CURRENT_DATE)THEN 'New this month'WHEN DATE_PARSE(a.Last_Appearance, '%Y-%m') <= DATE_TRUNC('month', CURRENT_DATE - INTERVAL '6' month)THEN 'Inactive in last six months'ELSE 'Active in last six months'END AS Category,COUNT(DISTINCT (a.User))FROM (SELECT"from" AS User,MIN(DATE_FORMAT(block_time, '%Y-%m')) AS First_Appearance,MAX(DATE_FORMAT(block_time, '%Y-%m')) AS Last_AppearanceFROM optimism.transactionsGROUP BY"from") AS aGROUP BY1