Query editor
withcomplete as (select created_at, fidfrom dune.neynar.dataset_farcaster_castsunionselect created_at, fidfrom dune.neynar.dataset_farcaster_reactions),dau as (-- This part of the query can be pretty much anything.-- The only requirement is that it have three columns:-- dt, user_id, inc_amt-- Where dt is a date and user_id is some unique identifier for a user.-- Each dt-user_id pair should be unique in this table.-- inc_amt represents the amount of value that this user created on dt.-- The most common case is-- inc_amt = incremental revenue from the user on dt-- If you want to do L28 growth accounting, user inc_amt=1.-- The version here derives everything from the tutorial.yammer_events-- data set provided for free by Mode.-- If you edit just this part to represent your data, the rest-- of the query should run just fine.-- The query here is a sample that works in the public Mode Analytics-- tutorial.selectfid as user_id,date_trunc('day',created_at) as dt,1 as inc_amtfrom completegroup by 1,2),-- First, set up WAU and MAU tables for future usewau as (selectdate_trunc('week', dt) as week,user_id,sum(inc_amt) as inc_amtfrom daugroup by 1,2),mau as (selectdate_trunc('month',dt) as month,user_id,sum(inc_amt) as inc_amtfrom daugroup by 1,2),-- This determines the cohort date of each user. In this case we are-- deriving it from DAU data but you can feel free to replace it with-- registration date if that's more appropriate.first_dt as (selectuser_id,min(dt) as first_dt,date_trunc('week', min(dt)) as first_week,date_trunc('month', min(dt)) as first_monthfrom daugroup by 1