I'm building out a Google Data Studio dashboard and I need to create a calculated field for the year a post was published. The year is in the URI path, but I'm not sure how to extract it using REGEXP_EXTRACT
. I've tried a number of solutions proposed on here but none of them seem to work on Data Studio.
In short, I have a URI like this: /theme/2019/jan/blog-post-2019/
How do I use the REGEXP_EXTRACT
function to get the first 2019 after theme/
and before /jan
?
REGEXP_EXTRACT(Page, '/([0-9]{4})/')
– Wiktor Stribiżew