LittlerDataosmosis - locating active users
Updated 2022-10-19Copy Reference Fork
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 dating as (
select
distinct block_timestamp
,tx_from
from osmosis.core.fact_transactions
where block_timestamp between '2022-10-10' and '2022-10-16 23:59:59'
group by 2, 1
),
counting as (
select
tx_from
,case when block_timestamp ilike '%2022-10-10%' then '1' else '0' end as monday
,case when block_timestamp ilike '%2022-10-11%' then '1' else '0' end as tuesday
,case when block_timestamp ilike '%2022-10-12%' then '1' else '0' end as wednesday
,case when block_timestamp ilike '%2022-10-13%' then '1' else '0' end as thursday
,case when block_timestamp ilike '%2022-10-14%' then '1' else '0' end as friday
,case when block_timestamp ilike '%2022-10-15%' then '1' else '0' end as saturday
,case when block_timestamp ilike '%2022-10-16%' then '1' else '0' end as sunday
from dating
group by 1, 2, 3, 4, 5, 6, 7, 8
),
grouping as (
select
tx_from
,sum(monday + tuesday + wednesday + thursday + friday + saturday + sunday) as days_active
from counting
group by 1
)
select
count(tx_from)
,days_active
from grouping
Run a query to Download Data