Updated 2023-02-03Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
›
⌄
WITH Transactions AS(
SELECT BLOCK_TIMESTAMP,
ROW_NUMBER() over (partition BY BUYER order BY BLOCK_TIMESTAMP ASC) AS rowNumber,
TX_ID,
BUYER
FROM flow.core.ez_nft_sales
WHERE NFT_COLLECTION='A.e4cf4bdc1751c65d.AllDay' AND TX_SUCCEEDED='TRUE'
)
,firstTransactions AS(
SELECT *
FROM Transactions
WHERE rowNumber=1
)
SELECT
date_trunc('week',BLOCK_TIMESTAMP) AS day,
count(DISTINCT BUYER) as numberNewUser,
sum(numberNewUser) over(ORDER BY day) AS cum_newbuyer
FROM firstTransactions
GROUP BY 1
Run a query to Download Data