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

Regexp_Extract Not Working

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hello, 

 

I am trying to extract the end of a url when my event action's from google analytics are a download and create a new calculated dimension in Data Studio. I want to extract the string after the last slash of the url all the way to the end of the url. So far I have written the following case statement, but DataStudio tells me that it cannot parse the formula. Could anyone tell me why this doesn't work? 

 

Here is the event action: 

download http://test.data.org/site/DocServer/RFL_CY16_Individual_Incentives.pdf?docID=372796

 

Here is what I want to extract: 

RFL_CY16_Individual_Incentives.pdf?docID=372796

 

Here is the calculated dimension I wrote: 

CASE WHEN REGEXP_MATCH(event action, 'download.*') THEN REGEXP_EXTRACT(event action, '\/([^\/]+)\/?$') ELSE Event Action END

 

Here is what i get in return: 

could not parse formula

 

Screen Shot 2017-07-10 at 5.24.22 PM.pngScreen Shot 2017-07-10 at 5.24.31 PM.png