adriaparcerisasdau base 2
Updated 2024-01-16
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
daus as (
SELECT
distinct from_address as users,
trunc(block_timestamp,'week') as weeks,
count(distinct trunc(block_timestamp,'day')) as active_days
from base.core.fact_transactions
group by 1,2
having active_days>=4
),
active_users as (
SELECT
distinct from_address as user,
min(block_timestamp) as debut
from base.core.fact_transactions
where from_address in (select users from daus)
group by 1
)
select
trunc(debut,'week') as date,
count(distinct user) as new_DAUs,
sum(new_DAUs) over (order by date) as "Total new DAUs"
from active_users
where date>=current_date-interval '{{Months}} MONTHS'
and date<current_date
group by 1
order by 1 asc
QueryRunArchived: QueryRun has been archived