Chapter 5: Working with Text
5.7. Text Functions: REPLACE() and REGEXP_REPLACE()
One of the most handy text functions in Looker Studio is the REPLACE() function which allows us to replace a certain string with our desired text or output. Later in lesson 10.9, IFNULL
function will be introduced which does the same thing when we have null values.
Intro to RegEx Functions
There are times when we don’t know the exact characters we need to extract, replace, or search for in an existing text field but we know how to define the pattern of characters or text we need.
When this happens, we can utilize Regular Expressions (RegEx) functions to help us work with text more efficiently and in a flexible manner.
Later in the lesson we will demo how we can use the REGEXP_REPLACE() function to replace all occurrences of text which matches the regular expression pattern we define in the formula.
This is useful for categorizing or cleaning campaign titles and URLs among others.
📩 Receive my weekly Looker Studio tips
🖇 Connect with me on LinkedIn