I have a raw data that has multiple dates per category, and I use code case when category = \'referral\' then min(date) end as date_referral to get earliest dat
case when category = \'referral\' then min(date) end as date_referral