AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Data Studio
4.8K members online now
4.8K members online now
Ask questions about Data Studio
Guide Me
star_border
Reply

Add Trailing Slash to some rows and not others

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I have a report that includes rows with some trailing slashes and not others.

 

I need to consolidate these into the same row. 

 

I came up with work around, but it's a little kludgey and I was wondering if someone had a better solution. 

 

My solution was:

1) Create a new Field called TEST that added a trailing slash to every row by CONCAT(Page, '/')

2) Create another new Field that looked for // and replaced with /. REPLACE(TEST, '//', '/')

 

That did work, but it's ugly. I tried a number of CASE WHEN statements and received errors every time. Does someone have a better way?

Add Trailing Slash to some rows and not others

Participant ✭ ✭ ☆
# 2
Participant ✭ ✭ ☆

I'm curious about this as well. I assume you're using Google Analytics? GA definitely is not good at combining page paths that are really the same thing (like, one has a capital letter and the other doesn't, or the trailing slash you mentioned). 

Add Trailing Slash to some rows and not others

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Yes, I am using GA here in this use case.

 

GA gives you options to add trailing slashes using View filters. There's a number of tutorials on how to do that.

 

But if your data is already polluted, I'm curious how you transform it using Data Studio.