Is there a posibillity to search for names in source?
CASE
WHEN Source="facebook_instagram" OR Source="facebook.com" OR Source="m.facebook.com" OR Source="instagram.com" OR Source="instagram" OR Source="l.facebook.com" OR Source="lm.facebook.com" OR Source="facebook" OR Source="de-de.facebook.com" Then "Social"
ELSE "Sonstige"
END
Is there a way to select all facebook sources, without list them?
You can certainly reduce the amount of code by using REGEXP_MATCH
For example
CASE
WHEN REGEXP_MATCH(Source, '.*facebook.*') OR REGEXP_MATCH(Source, '.*instagram.*') THEN 'Social'
ELSE 'Sonstige'
END
Another option to get rid of some of the duplication is to use in. For your code that would result in something like:
CASE
WHEN Source IN("facebook_instagram", "facebook.com", "m.facebook.com", "instagram.com", "instagram", "l.facebook.com", "lm.facebook.com", "facebook", "de-de.facebook.com") Then "Social"
ELSE "Sonstige"
END