Query editor
with unlock_day as(SELECTfrom_unixtime(cast(unlock_time_unixtime AS double)) AS time_day,provider,case when from_unixtime(cast(unlock_time_unixtime AS double)) > DATE_TRUNC('day',now()) then 'future' else 'past' end as if_now,sum(value) as day_unlock_value,count(distinct provider) as day_unlock_addressFROM query_3012163group by 1,2),withdraw_day AS (SELECTprovider,-1*SUM(value / 1e18) AS day_withdraw_valueFROM opnx_ethereum.VotingEscrow_evt_Withdrawgroup by 1)select time_day,if_now,case when if_now = 'future' then 0 else sum(day_withdraw_value) end as day_withdraw_value,sum(day_unlock_value) as day_unlock_valuefrom unlock_day aleft join withdraw_day bon a.provider = b.providergroup by time_day,if_now