vendettaweekly active users
Updated 2024-08-06
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
news as (
SELECT
distinct FROM_ADDRESS as users,
min(trunc(BLOCK_TIMESTAMP,'week')) as debut
from base.core.fact_transactions
group by 1
),
news2 as (
select distinct debut,
count(distinct users) as new_users
from news group by 1
),
actives as (
SELECT
trunc(BLOCK_TIMESTAMP,'week') as week,
count(distinct FROM_ADDRESS) as active_users
from base.core.fact_transactions x
group by 1 order by 1 desc
),
final as (
select
week, active_users,new_users, sum(new_users) over (order by week) as unique_users
from actives a join news2 n on a.week=n.debut
--where week<trunc(current_date,'week')
order by 1 asc
),
final2 as (
select
week, active_users,new_users, sum(new_users) over (order by week) as unique_users
from actives a join news2 n on a.week=n.debut
--where a.week<current_date-INTERVAL '2 WEEKS'
where a.week<current_date-INTERVAL '1 WEEK'
order by 1 asc
),
final_week as (select * from final order by 1 desc limit 1),
QueryRunArchived: QueryRun has been archived