Query editor
WITH linea AS (SELECTDATE_TRUNC('day', block_time) AS date_time,COUNT(DISTINCT (hash)) AS txs,COUNT(DISTINCT ("from")) AS total_active_users,SUM((TRY_CAST(gas_used AS DOUBLE) * TRY_CAST(gas_price AS DOUBLE)) / 1e18) AS all_tx_feeFROM linea.transactionsWHEREblock_time > CURRENT_TIMESTAMP - INTERVAL '180' dayAND DATE(block_time) >= DATE(TRY_CAST('2023-07-10' AS TIMESTAMP))GROUP BY1), new_users AS (SELECTbirth_date,COUNT(DISTINCT ("from")) AS total_new_usersFROM (SELECT"from",MIN(DATE(block_time)) AS birth_dateFROM base.transactionsGROUP BY1)GROUP BY1)SELECTdate_time,txs,all_tx_fee,total_active_users,total_new_users,total_active_users - total_new_users AS returning_users,SUM(total_new_users) OVER (ORDER BY date_time) AS cumulative_new_usersFROM lineaLEFT JOIN new_usersON birth_date = date_timeORDER BYdate_time DESC