FatemeTheLady01 active users
Updated 2023-04-19
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
›
⌄
with
new as (
SELECT
distinct from_address as user,
min(block_timestamp) as date
from avalanche.core.fact_transactions
where block_timestamp::date>='{{StartDate}}' and block_timestamp::date<='{{EndDate}}'
group by 1
)
,
active_users as (
SELECT
date_trunc('day',block_timestamp) as date,
count(distinct from_address) as count_users
from avalanche.core.fact_transactions
where block_timestamp::date>='{{StartDate}}' and block_timestamp::date<='{{EndDate}}'
group by 1
)
select
trunc(date,'{{Timestamp}}') as "Timestamp",
sum(count_users) as "Active users",
AVG("Active users") OVER (ORDER BY "Timestamp" ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS "7MA",
sum("Active users") over (order by "Timestamp") as "Total active users"
from active_users
group by 1
order by 1 asc
Run a query to Download Data