Query editor
WITHTraded_Collections AS (SELECTtrades.blockchain as blockchain,CASEWHEN coalesce(ctokens.is_creator_token, false) THEN 'CREATOR'ELSE 'VANILLA'END AS collection_type,nft_contract_address,MIN(block_time) as firstTradeTimeFROMnft.trades trades left joinlimitbreak.creator_tokens ctokens on trades.nft_contract_address = ctokens.address and trades.blockchain = ctokens.blockchainWHEREDATE(date_trunc('day', block_time)) > DATE('2023-05-01')GROUP BY trades.blockchain, nft_contract_address, ctokens.is_creator_token)SELECTDATE(date_trunc('week', firstTradeTime)) as block_year_week_day,collection_type,COUNT(*)FROM Traded_CollectionsWHERE blockchain={{Chain}} and blockchain not in ('optimism', 'bnb')GROUP BY collection_type, date_trunc('week', firstTradeTime)ORDER BY collection_type, date_trunc('week', firstTradeTime)