How to strip unwanted text from a GA dimension using REGEX_REPLACE function in Google Data Studio
Here’s a clean way to amend the info. shown in GDS. Let’s say your Event Action field contains a certain pattern of text that is redundant and you don’t want to include in your Google Data Studio table.
Regex_Replace () function in GDS was created for this purpose.
The parameters are (Field, regex of what you want to remove, value that you want to include).
In below example, I have an Event Action dimension in GA that contains the text “ - Value in AED” in all rows. Here’s the function that you can use to create a custom field that sources the original Event Action field and modifies it (replacing “ - Value in AED” with space “ “ )
Code:
REGEXP_REPLACE(Event Action,' - Value in AED', '')