Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
RÉSOLU

Parsing based on character

dan_b
Météore

Hello,

How do I parse a column based on the last character that separates a string? In the example below, i want to create a column that grabs Detroit and Holland. 

 

Region/CityCity
United States/Michigan/DetroitDetroit
United States/Michigan/West Michigan/HollandHolland
4 RÉPONSES 4
NicoleJohnson
ACE Emeritus
ACE Emeritus

This regular expression ought to do the trick, in the RegEx tool:

 

.*/(\w*)$

 

Output method should be Parse or Replace (if replace, designate $1 as the marked group you want to keep). Does that work for you?

 

Cheers!

NJ

Joe_Mako
Quasar

Using (.*) as the capture group instead of (\w*) would capture all characters after the last slash, because sometimes a city has a space in its name, and the \w will return a Null in that case. See attached for example.

dan_b
Météore

Thank you! 

thompska
Atome

how would I alter this process to put what is before the last slash into it's own column?  Using your example - take column Region/City and create 2 new columns - Region, City?

 

Sondage
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Étiquettes