If contains statement beast mode

Reply
Highlighted
White Belt

If contains statement beast mode

I essentially have a list of URLs in one column and need to extract out the advertiser into a new column. I want to use an if contains statement to search every row in data set and see if it holds the pertaining advertiser name. Below is what I what both columns to look like and the code that I tried. 

 

COL.a     COL.b

url            Advertiser name

 

CASE
WHEN `Page` LIKE '%adCREASIANs%' THEN 'By Gina'
WHEN `Page` LIKE '%Aerovex SystemsInc%' THEN 'Hemp Beauty'
ELSE 'NA'
END;


Accepted Solutions
White Belt

Re: If contains statement beast mode

remove the ; at the end of the syntax 

 

case when `url` like '%goo%' then 'google'

when `url` like '%adCREASIANs%' THEN 'By Gina'

when `url` like '%Aerovex SystemsInc%' THEN 'Hemp Beauty'

else 'na' end


All Replies
White Belt

Re: If contains statement beast mode

remove the ; at the end of the syntax 

 

case when `url` like '%goo%' then 'google'

when `url` like '%adCREASIANs%' THEN 'By Gina'

when `url` like '%Aerovex SystemsInc%' THEN 'Hemp Beauty'

else 'na' end

Announcements
Looking for the latest Community solutions? Please visit our accepted solutions board here!