Query editor
withkelp_base as (select *,depositor as userfrom query_3311774),first_use as (selectuser,min(evt_block_time) as first_time,'new depositor' as user_typefrom kelp_basegroup by 1),usr_return_or_not as (selecta.*,coalesce(user_type,'returning depositor') as user_typefrom kelp_base a left join first_use fon a.user=f.userand a.evt_block_time = f.first_time),user_info as (selectdate_trunc('day',evt_block_time) as date,-- user_type,count(case when user_type='new depositor' then user else null end) as new_depositors,count(case when user_type!='new depositor' then user else null end) as returning_depositors,count(distinct user) as active_depositors,sum(count(case when user_type='new depositor' then user else null end)) over (order by date_trunc('day',evt_block_time)) as depositors_growthfrom usr_return_or_notgroup by 1)selectdate,new_depositors,returning_depositors,depositors_growth,active_depositors,cast(active_depositors as double)/cast(depositors_growth as double) as growth_percent,100.0*cast(active_depositors as double)/cast(depositors_growth as double) as growth_percent_counter-- active_depositors/(depositors_growth-active_depositors) as growth_percentfrom user_infoorder by 1 desc