Query editor
WITH time_filtered_data AS (SELECTDATE_TRUNC('month', at_timezone(evt_block_time, 'Asia/Kolkata')) AS month,reciever AS user_accountFROMfantv_polygon.fantv_dapp_evt_CreditUNION ALLSELECTDATE_TRUNC('month', at_timezone(evt_block_time, 'Asia/Kolkata')) AS month,sender AS user_accountFROMfantv_polygon.fantv_dapp_evt_DebitUNION ALLSELECTDATE_TRUNC('month', at_timezone(evt_block_time, 'Asia/Kolkata')) AS month,"from" AS user_accountFROMfantv_polygon.FanTigerMarketplace_evt_PurchaseBatch),monthly_active_users AS (SELECTmonth,COUNT(DISTINCT user_account) AS unique_active_users,ROW_NUMBER() OVER (ORDER BY month) AS row_numFROMtime_filtered_dataGROUP BYmonth),cumulative_active_users AS (SELECTmonth,SUM(unique_active_users) OVER (ORDER BY month) AS cumulative_active_usersFROMmonthly_active_users),average_active_users AS (SELECTmonth,AVG(unique_active_users) OVER (ORDER BY month ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) AS avg_active_users_last_7_daysFROMmonthly_active_users)SELECTdate_format(month, '%b-%y') AS formatted_month,unique_active_users AS MAW,cumulative_active_users AS cumulative_MAW,avg_active_users_last_7_days AS avg_MAW_last_30_daysFROMmonthly_active_usersJOIN cumulative_active_users USING (month)JOIN average_active_users USING (month)ORDER BYmonth