LittlerDataUntitled Query
Updated 2022-12-20
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
with users_month as (
select
date_trunc('month',block_timestamp) as month_logd
,proposer as user
from flow.core.fact_transactions
where block_timestamp >= '2022-01-01'
group by 2, 1
),
first_month as (
select
min(block_timestamp) as first_month
,proposer as user
from flow.core.fact_transactions
where block_timestamp >= ''
group by 2
),
joining as (
select
user
,first_month
,month_logd
,row_number() over (partition by user order by month_logd asc) as row_count
from users_month
full outer join first_month using (user)
group by 1, 2, 3
),
monthing as (
select
first_month
,user
,sum(case when month_logd = '2022-01-01 00:00:00.000' then 1 else 0 end) as Month_1
,sum(case when month_logd = '2022-02-01 00:00:00.000' then 1 else 0 end) as Month_2
,sum(case when month_logd = '2022-03-01 00:00:00.000' then 1 else 0 end) as Month_3
Run a query to Download Data