Query editor
WITHfirst_deposit AS (SELECT"from" AS user,MIN(evt_block_time) AS first_dateFROMerc721_ethereum.evt_TransferWHERE"to" = FROM_HEX('55bd50f2cab21eba0ea09a952ffe8d754638ad30')GROUP BY"from"),daily_new_user AS (SELECTDATE(first_date) AS date,COUNT(*) AS daily_new_usersFROMfirst_depositGROUP BYDATE(first_date)),total_user AS (SELECTdate,daily_new_users,SUM(daily_new_users) OVER (ORDER BYdate) AS total_usersFROMdaily_new_user),previous_total_wallet AS (SELECTdate,total_users,LAG(total_users) OVER (ORDER BYdate) AS previous_totalFROMtotal_user),total_engaged_wallet AS (SELECTDATE(datetime) as date,total,SUM(total) OVER (ORDER BYdatetime) AS total_usersFROMdune.trangpt.dataset_engaged_wallet_stats)SELECTCOALESCE(b1.date, b2.date) AS datetime,COALESCE(b1.daily_new_users, 0),COALESCE(b1.total_users, b3.previous_total),COALESCE(b2.total, 0),COALESCE(b2.total_users, 0)