Diving headfirst into the world of Looker Studio(formerly Google Data Studio), we come across an impressive function called 'CONTAINS_TEXT'. This function is an integral tool in the GDS toolkit. Its main task is to search for a specific sequence of characters within a text field or towards an expression and then respond with either true or false output based on whether the said sequence is found.
Like every function, CONTAINS_TEXT has its own unique syntax that defines its structure.
Now let's dissect the syntax for a clearer understanding.
The syntax for this function is -
Here, 'X' is representative of any field or expression that seeking to be examined, while 'text' is the specific character sequence or value that you're searching for within 'X'.
It is critical to note that 'text' in this syntax is case sensitive.
Now that we've broken down the function, let's illustrate how you can use CONTAINS_TEXT with a few examples, keeping it interesting with a sales metrics context:
Suppose, we are looking at a dataset including sales revenues from various e-commerce campaigns. If we want to filter out campaigns that have 'BlackFriday' in their names, we could write:
Google Data Studio would then pull out all campaigns containing 'BlackFriday' in their names.
Exploring further, let's say, you're trying to find out whether the sales in 'Q4' have been higher than those in 'Q3'. You might use the CONTAINS_TEXT function as follows:
This will inform you whether 'Q4' is mentioned in the specified field or not.
While CONTAINS_TEXT can deliver powerful and insightful results, it's also important to keep its limitations in mind. The key one is that CONTAINS_TEXT is case sensitive. Therefore, if you are looking for 'BlackFriday' and the field contains 'blackfriday', it will return 'false'.
Therefore, be careful to ensure consistency in your text case when using this function.
By understanding its wide range of applications, strengths, as well as limitations, you can harness the full potential of the CONTAINS_TEXT function within Google Data Studio to extract meaningful insights from your dataset.
Become a Looker Studio expert
for free
Learn all the secrets of data analysis and create beautiful and effective dashboards thanks to our 30-second video courses! Join Catchr's community on YouTube.
Get more video lessonsAll your data on Looker Studio
Build Looker Studio dashboard easily with your marketing data from all platforms and track your essential KPIs! No-code integration.
Start free trial now!Optimize your data analysis
Get free Looker Studio dashboard template among a large collection of +50 stunning template! Elevate your data visualization.
Get free templates!