Skip to content

Instantly share code, notes, and snippets.

@robhammond
Last active August 6, 2018 16:49
Show Gist options
  • Save robhammond/e00e86a5a0a5926793c872013a79f587 to your computer and use it in GitHub Desktop.
Save robhammond/e00e86a5a0a5926793c872013a79f587 to your computer and use it in GitHub Desktop.
Custom Site Groupings dimension - Data Studio
CASE
WHEN (REGEXP_MATCH(Page/Screen Path (Clean),".*?(mirror.co.uk|dailyrecord.co.uk|irishmirror.ie|insider.co.uk|belfastlive|glasgowlive|dublinlive|rsvplive.ie).*$")) THEN "Nationals"
WHEN (REGEXP_MATCH(Page/Screen Path (Clean),".*?(manchestereveningnews.co.uk|liverpoolecho.co.uk|walesonline|birminghammail|chroniclelive|bristolpost|hulldailymail|nottinghampost|plymouthherald|leicestermercury).*$")) THEN "Regional Capitals"
WHEN (REGEXP_MATCH(Page/Screen Path (Clean),".*?(derbytelegraph|gazettelive|stokesentinel|coventrytelegraph|examiner|cambridge-news|grimsbytelegraph|chesterchronicle|leeds-live|getwestlondon|burtonmail|scunthorpetelegraph).*$")) THEN "Urban Hub"
WHEN (REGEXP_MATCH(Page/Screen Path (Clean),".*?(croydonadvertiser|hertfordshiremercury|birminghampost|macclesfield-express|crewechronicle|rossendalefreepress|accringtonobserver|loughboroughecho|hinckleytimes).*$")) THEN "Community Sites"
WHEN (REGEXP_MATCH(Page/Screen Path (Clean),".*?(dailypost|devonlive|gloucestershirelive|getsurrey|somersetlive|cornwalllive|essexlive|kentlive|lincolnshirelive).*$")) THEN "County Sites"
WHEN (REGEXP_MATCH(Page/Screen Path (Clean),".*?(football.london).*$")) THEN "Football London"
ELSE "(Other)"
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment