0-MIDmonthly new supplier
Updated 2023-04-13
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
›
⌄
with tab1 as (
select min(date_trunc('month',BLOCK_TIMESTAMP))as month, SUPPLIER
, case
when month>='2019-05-01'and month<'2020-01-01'then '2019'
when month>='2020-01-01'and month<'2021-01-01'then '2020'
when month>='2021-01-01'and month<'2022-01-01'then '2021'
when month>='2022-01-01'then '2022' end as time_period
from ethereum.compound.ez_deposits
--where month>='2019-05-01'
group by 2)
select month,time_period,count(SUPPLIER)as new_suppliers
,sum(new_suppliers)over(order by month asc)as cum_new_suppliers
from tab1
group by 1,2
Run a query to Download Data