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- DateTime field to Date & Hour separately

ppatel
7 - Meteor

Hi,

I am looking help to convert the DateHour field to Date & Hour by separating them. 


Capture11.PNG

Trying to convert above DateHour field as following Time field. 

 

Capture12.PNG 

 

Many thanks,

9 REPLIES 9
danrh
13 - Pulsar

Something like this should do the trick:

image.png

I'm adding a field for the ending hour, parsing to just the hour (with AM/PM attached) of both fields, and doing some formatting at the end to concatenate.

 

Hope it helps!

ppatel
7 - Meteor

Thank you very much, This is what I needed,

 

Now, I only want to change for example, if HourEnd is 1 then TimePeriod should be like 1 To 2 AM

 

Below is the current fields,

Capture13.PNG

 

Trying to convert with this,

 

Capture14.PNG

 

danrh
13 - Pulsar

It looks like there might be an issue with your DateTime tool for your HourStart field (everything is null?).  Can you post a screen shot of the tool's configuration?

ppatel
7 - Meteor

Sure, Kindly check attached my current workflow. 

 

Thank you

danrh
13 - Pulsar

Toss in "HH %p" in the custom format field, looks like maybe this got wiped out somehow.

 

image.png

ppatel
7 - Meteor

Great, I just changed to HH %p now it looks good,

 

Last thing, what am trying to do is, if the HourStart field is 12 AM than TimePeriod should be like 12 AM To 1 AM. So, I how I change the HourEnd field to 1 AM ?

 

Capture15.PNG

 

Thanks again..

danrh
13 - Pulsar

Your HourEnd field should be based off of the EndHour datetime field but it looks like it's formatting the DateHour field.  Using the workflow you sent me and only making the one change I mentioned above, I'm getting the right result:

image.png

ppatel
7 - Meteor

Yes, you are right and, now I got everything what I needed.

 

Thank you..

danrh
13 - Pulsar

You bet, glad it worked!

Labels