Search code examples
regexlooker-studiore2

Looker Studio rename output of city metric


Some city data is being returned with "(not set)" which I've figured out how to filter out via regex BUT I would instead like to change it to something else eg "(Unset Location)" or similar. Is this a possibility?


Solution

  • Pretty straight forward, as I'd originally hoped. I created a custom dimension and used the following for the formula input.

    REGEXP_REPLACE(City, '^\\(not set\\)$','Undetermined')
    

    Steps:

    1. Select "Add dimension"

    enter image description here

    1. Select "CREATE FIELD"

    enter image description here

    1. Insert Formula

    enter image description here