Query editor
WITH UAW_30days AS (SELECT COUNT(DISTINCT total_accounts) AS active_walletsFROM (SELECT sender AS total_accountsFROM fantv_polygon.fantv_dapp_evt_DebitWHERE date_diff('day', evt_block_time, current_date) < 30AND date_diff('day', evt_block_time, current_date) >= 0UNION ALLSELECT reciever AS total_accountsFROM fantv_polygon.fantv_dapp_evt_CreditWHERE date_diff('day', evt_block_time, current_date) < 30AND date_diff('day', evt_block_time, current_date) >= 0UNION ALLSELECT "from" AS total_accountsFROM fantv_polygon.FanTigerMarketplace_evt_PurchaseBatchWHERE date_diff('day', evt_block_time, current_date) < 30AND date_diff('day', evt_block_time, current_date) >= 0) AS UAW_30days),TotalUsers AS (SELECT COUNT(DISTINCT total_users) AS total_users_countFROM (SELECT sender AS total_usersFROM fantv_polygon.fantv_dapp_evt_DebitUNION ALLSELECT reciever AS total_usersFROM fantv_polygon.fantv_dapp_evt_CreditUNION ALLSELECT "from" AS total_usersFROM fantv_polygon.FanTigerMarketplace_evt_PurchaseBatch) AS all_users)SELECTUAW_30days.active_wallets AS UAW_30days,TotalUsers.total_users_count AS total_users,COALESCE(UAW_30days.active_wallets, 0) AS UAW_30days,(COALESCE(UAW_30days.active_wallets, 0) / CAST(TotalUsers.total_users_count AS DOUBLE)) * 100 AS active_percentageFROMUAW_30days, TotalUsers;