OneDataAnalystDAU Actions on OSMOSIS
Updated 2022-10-20Copy 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 t1 AS (
SELECT DISTINCT Date_trunc('day',BLOCK_TIMESTAMP) AS Date, TX_FROM
FROM osmosis.core.fact_transactions
),
t2 AS (
SELECT Date_trunc('week',date) AS week, TX_FROM, Count(*) AS Active_days
FROM t1
GROUP BY 1,2
),
t3 AS(
SELECT TX_FROM
FROM t2
WHERE Active_days>= 4
),
t33 AS(
SELECT TX_FROM, count(*) AS Active_weeks
FROM t2
WHERE Active_days >= 4
GROUP BY 1 ),
t00 AS (
SELECT Min(Date_trunc('day',BLOCK_TIMESTAMP)) AS first_Date, TX_FROM
FROM osmosis.core.fact_transactions
Group By 2
),
t01 AS (
SELECT TX_FROM AS User0, (DATEDIFF('day',first_Date,CURRENT_DATE)/7) AS Week_old
FROM t00
) ,
t44 AS (
Run a query to Download Data