Query editor
WITHcreators AS (-- Define the list of creators and their FIDsSELECT*FROM(VALUES(14601, 'Dawnia Darkstone'),(3281, 'Anthony Azekwoh'),(372057, 'Shavonne Wong'),(446308, 'Jayden Hills'),(1556, 'MeetQuack'),(13165, 'ETH Daily'),(326567, 'Sara Phillips'),(248093, 'Blake Finucane'),(780900, 'Naomi Metzger'),(834869, 'Stump Club')) AS creator_data (target_fid, creator_name)),date_series AS (-- Extract all distinct days with any follower activity since August 1, 2024SELECT DISTINCTDATE_TRUNC('day', timestamp) AS trunc_dateFROMdune.neynar.dataset_farcaster_linksWHEREtimestamp >= DATE '2024-08-01'),follow_data AS (SELECTDATE_TRUNC('day', timestamp) AS trunc_date,target_fid,COUNT(DISTINCT fid) AS follower_count -- Count unique followersFROMdune.neynar.dataset_farcaster_linksWHEREtimestamp >= DATE '2024-08-01'AND type = 'follow' -- Only include 'follow' type linksAND target_fid IN (SELECTtarget_fidFROMcreators) -- Use the subquery for FID filteringGROUP BYDATE_TRUNC('day', timestamp),target_fid),-- Combine generated dates with follow data for each creatorfollow_data_with_dates AS (SELECTd.trunc_date,c.target_fid,c.creator_name,COALESCE(f.follower_count, 0) AS follower_count -- Fill missing dates with 0 followersFROMdate_series dCROSS JOIN creators c -- Join with the creators tableLEFT JOIN follow_data f ON d.trunc_date = f.trunc_date