Query editor
with daily as (select'Total' as tot,date_trunc('month', block_time) as month,block_date,count(distinct tx_from) as daily_usersfrom xchange.tradeswhere block_date >= timestamp '2023-06-01'--where block_date >= current_date - interval '12' daygroup by'Total',date_trunc('month', block_time) ,block_date),monthly as (select'Total' as tot,date_trunc('month', block_time) as month,count(distinct tx_from) as cur_month_usersfrom xchange.tradeswhere block_date >= timestamp '2023-06-01'--where block_date >= current_date - interval '12' daygroup by'Total',date_trunc('month', block_time)),total as (select'Total' as tot,count(distinct tx_from) as total_usersfrom xchange.tradeswhere block_date >= timestamp '2023-06-01'--where block_date >= current_date - interval '12' daygroup by'Total')selecta.month, a.block_date, a.daily_users,b.cur_month_users, c.total_usersfromdaily a inner join monthly b on a.month=b.monthinner join total c on a.tot=c.totorder by a.month, a.block_date