community
cancel
Showing results for 
Search instead for 
Did you mean: 
Annoucement | Get certified today - take the Alteryx Designer Core and Advanced exams on-demand now!
Do you have the skills to make it to the top? Subscribe to our weekly challenges. Try your best to solve the problem, share your solution, and see how others tackled the same problem. We share our answer too.
Weekly Challenge
Do you have the skills to make it to the top? Subscribe to our weekly challenges. Try your best to solve the problem, share your solution, and see how others tackled the same problem. We share our answer too.
Unable to display your progress at this time. Please try again a little later, or contact an administrator if you continue to see this error.

Challenge #34: Date-Time Formatting

Highlighted
Alteryx Alumni (Retired)

Here is this week’s challenge, I would like to thank everyone for playing along and for your feedback.  The link to the solution for last challenge #33 is HERE.  For this chalenge let’s look at creating a macro from scratch.  I recommend you first solve the problem with tools on the canvas, then cake a macro from the tools.

 

Use Case:  Our customer has a need to convert date/time strings into a date-time format.

 

Examples of the different input formats include:  4/8/2015 4:00, 5/10/2015 13:00.  The conversion is automatic when the hours are 2 digits (10-24), but it ignores hours 1-9 (creates NULL values on conversion).

 

Objective:  Create a macro to effectively convert and preserve the data in a date-time format.

Alteryx Partner

Thank you for posting this amazing exercise. 

I am new to Alteryx community. Does anyone know how to upload my yxmd and yxmc files onto Alteryx Community?


Here is my smiling-face macro:

Capture1.PNG

Here is what's inside my smiling-face macro:

 

Spoiler
Capture2.PNG

 

Community Content Engineer
Community Content Engineer

Here's a solution:

Spoiler
Exercise 34 Solution.PNG
Aurora
Aurora

nice quick one.

Solution attached - very similar to the provided solution

Alteryx Certified Partner
Alteryx Certified Partner

I think that this is straight-forward (after finding the reverse update).

 

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.

My solution.... in a single formula!! This might be the first time I've had a one-tool solution!! :)

 

Spoiler
Formula Tool = DateTimeParse(Left([date_time],FindString([date_time]," "))+" "+PadLeft(Substring([date_time],FindString([date_time]," ")+1,8),5,"0"),"%m/%d/%Y %H:%M:%s")

 

Quasar

My solution. Took a number of tries to get everything right.

Alteryx Certified Partner

I think the datetime convert maybe my favourite tool...so easy and simple

 

Spoiler
Weekly Challenge 34.png
Alteryx Certified Partner

Solution Attached.

Spoiler
Capture.PNG