SOLVED
Extract partial text from a url
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
moe
6 - Meteoroid
05-26-2016
07:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello,
I am trying to figure out a way to extract a part of text from the below url
mysites.com?utm_campaign=mycampaign_20160525_en&utm_medium=email&utm_source=google&utm_content=cart
How can i just take "utm_medium=email" from this url using Alteryx formula?
please let me know
thanks
Solved! Go to Solution.
Labels:
- Labels:
- Expression
1 REPLY 1
ACE Emeritus
05-26-2016
07:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I would suggest using a couple of REGEX tool.
First tokenise with expression
[?&]([^=]*=?[^&]+)
Then parse with a similar expression
([^=]+)=?(.*)
This will break it into field and value.
If all you want is that explicit key and value then you can use a Formula tool:
REGEX_Replace([URL], ".*[?&](utm_medium=[^&]+).*", "$1")
Attached example does both.
