Alteryx Designer Desktop Discussions

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

Dynamic Rename with Regex

AustinRiggs94
8 - Asteroid

Hi All,

 

I am still getting use to Regex and how to properly write the formula. I am trying to rename all the dates within the field so i can properly filter them later. The data i would like to see at the end is just Month, Day, year format (deleting all other info in string). Please let me know, thanks!

 

31-OCT-18 05.03.16.306000000 AM
31-OCT-18 05.03.16.304000000 AM
31-OCT-18 05.03.16.101000000 AM
31-OCT-18 05.03.15.908000000 AM
31-OCT-18 05.03.15.825000000 AM

31-MAY-18 05.01.08.658000000 AM
31-MAY-18 05.01.08.649000000 AM
31-MAY-18 05.01.08.259000000 AM

26-JUN-18 01.35.00.000000000 PM
26-JUN-18 01.35.00.000000000 PM
26-JUN-18 01.35.00.000000000 PM
26-JUN-18 01.35.00.000000000 PM

2 REPLIES 2
Thableaus
17 - Castor
17 - Castor

Hi @AustinRiggs94 

 

I don't think you need a RegEX in this case. A simple DateTimeParse function combined with DateTimeFormat to bring your desired format does the trick.

 

Format.PNG

Cheers,

estherb47
15 - Aurora
15 - Aurora

Hi @AustinRiggs94 ,

 

If you want to do this with a RegEx function, you can try this:

 

Regex_Replace([FieldName],"(.*?)(\s.*)","$1")

 

This function should grab everything preceding the space.

You can also try if the DateTimeParse tool would work, which would also turn the string into an actual date.

 

Cheers!

Esther

 

 

Labels