Query editor
-- Group each record into its corresponding monthWITH monthly_data AS (SELECTDATE_TRUNC('month', TRY_CAST(DateTime AS TIMESTAMP)) AS month_start,topup_total,Fees_total,Topup_countFROM dune.saltedpotatopie.result_daily_top_up_tracker_all)SELECTDATE_FORMAT(month_start, '%Y-%m (%b)') AS Date_,DATE_FORMAT(month_start, '%Y-%m') AS DateTime,-- Monthly totalsSUM(topup_total) AS Topup_Total,SUM(Fees_total) AS Fees_Total,SUM(Topup_count) AS Topup_CountFROM monthly_dataGROUP BY 1,2ORDER BY Date_ DESC;