I'm trying to clean up my data for a Google Data Studio report by replacing multiple spaces in a string with a single space using a REGEXP_REPLACE formula, but I cannot work out how to do it. I think this is a peculiarity when working in Google Data Studio.
Here is an example...
Record with Campaign name=
" This is an example string with many blank spaces "
I then create a Custom field in Data Studio with formula
REGEXP_REPLACE(Campaign name,'/s','')
I have tried adding in multiple combinations of:
/s+
/s*
\/s*\
s/g
[/s]
/s{5}
Note: do not be confused...when looking at the output results in Data Studio, Google strips out the extra spaces for presentation purposes - but they are still there and mess up sorting, etc.
