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

Split a field into Time & Date

Brawlstrogg
7 - Meteor

Hello folks,

 

I've got a datafield called DateTime where the format is as follows;

 

11/28/17 1:00:00 AM

11/28/17 1:30:00 AM

....

11/28/17 1:00:00 PM

11/28/17 1:30:00 PM

 

I've tried about twenty different combinations of formatting and parsing the data but can't seem to get any to work. Ideally what I'd like is as below;

 

DateTimeDateTime
11/28/17 1:00:00 AM11/28/201701:00
11/28/17 1:30:00 AM11/28/201701:30
.........
11/28/17 1:00:00 PM11/28/201713:00
11/28/17 1:30:00 PM11/28/201713:30

 

So a split down the middle and then the time reverting to a 24 hour clock, but I simply am being dense and can't figure it out.

 

Any help would be really appreciated!

4 REPLIES 4
vishwa_0308
11 - Bolide

Hi @Brawlstrogg,

 

I have tried to figure out your solution and hope this will serve the purpose. Please try the attached workflow and let me know.

 

Best,

Vishwa

Brawlstrogg
7 - Meteor

Nice one Vishwa. Works like a charm.

 

Thanks for your help!

 

B.

Kenda
16 - Nebula
16 - Nebula

@Brawlstrogg Another option would be to add a formula creating a field called Date with the following expression:

REGEX_Replace([DateTime], "(.*?)\s.*", "$1")

and a second field called Time with the following expression:

DateTimeParse(REGEX_Replace([DateTime], "(.*?)\s(.*)", "$2"),"%X")

Hope this helps and gives you some exposure to some new formulas you may not have ever used before!

Brawlstrogg
7 - Meteor

Always looking to learn more formulas!

 

Thanks very much!

Labels