Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Trimming/Removing characters from V_String

AlisonK39
7 - Meteor

Hi, 

 

Newbie here.  I have a V_String fields that contains Last name, First name, date and time.  I'm trying to remove the last name, first name and time so that I'm just left with the date.  

 

Ex - Smith, John K 2/18/2019 8:57:00 AM

 

The name lengths aren't uniform, so I can't do a "trim" .  

 

Thank you! 

Alison

 

 

4 REPLIES 4
MarqueeCrew
20 - Arcturus
20 - Arcturus

@AlisonK39 ,

 

I'd like to introduce you to my friend, RegEx.  It performs pattern matching.

 

Regex_Replace([Field],".*(\d+\/.*)",'$1')

 

That formula will get you everything at the end of your string that starts with 1 or 2 digits followed by a slash.

 

Cheers,


Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
LordNeilLord
15 - Aurora

Hey @AlisonK39 

 

I'd be tempted to just parse out the date using the regex tool with something like: .*\s(\d+/\d+/\d+\s\d+:\d+:\d+ \w+)Capture.PNG

BenMoss
ACE Emeritus
ACE Emeritus

An alternative  (though similar solution to @MarqueeCrew 's post), would be to use the actual RegEx tool in parse mode with the following configuration...

 

clipboard_image_0.png

AlisonK39
7 - Meteor

Thanks so much - this worked perfectly!  

Labels