Query editor
WITH-- Genuine entries per player = initial purchases - admin initializedentry_s AS (SELECTe.player,(COUNT(e.player) - COALESCE(a.admin_count, 0)) * 0.1 AS entry_sFROM robdotfun_bnb.main_evt_initialfacilitypurchased eLEFT JOIN (SELECTuser AS player,COUNT(*) AS admin_countFROM robdotfun_bnb.main_evt_admininitializedfacilityGROUP BY user) a ON e.player = a.playerGROUP BY e.player, a.admin_count),-- total adjusted CASH from entriestotal_s AS (SELECTSUM(entry_s) AS total_s_entriesFROM entry_s),-- per-player hideout spendfacility_spend AS (SELECTplayer,SUM(cost / 1e18) AS facility_spent,COUNT(*) AS total_barns_boughtFROM robdotfun_bnb.main_evt_facilityboughtGROUP BY player),-- per-player boxes opened (each box costs 300 CASH)box_spend AS (SELECTplayer,COUNT(*) AS boxes_opened,COUNT(*) * 300 AS box_spentFROM robdotfun_bnb.mysterybox_evt_boxopenedGROUP BY player),-- distinct players from initial purchases (unadjusted)players_total AS (SELECT COUNT(DISTINCT player) AS total_playersFROM robdotfun_bnb.main_evt_initialfacilitypurchased),-- global CASH totalscash_totals AS (SELECTmined."CASH Stolen",burned."CASH Burned"FROM (SELECT SUM(rewards / 1e18) AS "CASH Stolen"FROM robdotfun_bnb.main_evt_rewardsclaimed) AS minedCROSS JOIN (