Advent of Code is now back for a limited time only! Complete as many challenges as you can to earn those badges you may have missed in December. Learn more about how to participate here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

take data from the last - symbol

Sshasnk
8 - Asteroid

I want to take date from the last '-' which could be any but I always have to pick the last

 

Name
Ash Ketchum - US10100
Jhon-King - US10302
Big -Dog - KL0920
King - Pin - UIO10203
Bruce Wayne - UK10920

 

Output:

NameValue
Ash Ketchum - US10100Ash Ketchum
Jhon-King - US10302Jhon-King
Big -Dog - KL0920Big -Dog
King - Pin - UIO10203King - Pin
Bruce Wayne - UK10920Bruce Wayne

 

3 REPLIES 3
DataNath
17 - Castor
17 - Castor

Hey @Sshasnk, if you place a RegEx tool on your canvas and set the Output Method to 'Parse', the following expression will work:

 

(.*)-

 

If the hyphen always comes after a space, use the following so you don't need to then trim/clean up the parsed field afterwards:

 

(.*)\s-

 

Hope this helps!

Wesley Mendonca
9 - Comet

Hi Sshasnk,

 

You can use  Regex Tool to solve your problem. 

 

I attached a model to use in this case that you inserted as example.

Amit_G_Limbasia
9 - Comet

Dear @Sshasnk 

 

You can use the function called reverser string then use get right then reverse again as you just want to extract left part you can use this also.

Workflow attached. Thanks

Labels
Top Solution Authors