community
cancel
Showing results for 
Search instead for 
Did you mean: 
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 #4: Date Parsing

Alteryx Certified Partner

Here's my solution.

 

Spoiler
1) I started off by adding a record ID, isolating the part of the string containing the date and removing redundant characters:

Screen Shot 2017-08-20 at 16.28.29.png

2) I then used a formula tool to create three streams corresponding to the different date formats, first using Regex to test if the first character was a digit, which enabled me to identify the [Mon dd yyyy] strings, and for those where this was not the case using FindString to check if the last four characters contained a hype, which enabled me to identify [dd-Mon-yyyy] and [dd-Mon-yy].  These streams then fed into an appropriately configured DateTime tool.

Screen Shot 2017-08-20 at 16.33.22.png

3) Finally a bit of column cleaning and joined back to the original dataset using the record ID.

 
Screen Shot 2017-08-20 at 16.39.21.png

 

 

 

Highlighted
Atom
 
Asteroid

This one was a real challenge for me.  I did get the same results as the output indicated, but I have real doubts that the WC FIelds quote is from 2000.... :)

Alteryx Certified Partner
 
Alteryx Certified Partner

Just starting with Regex and here is my solution

Spoiler
Screen Shot 2017-08-26 at 20.00.24.png

 

Asteroid

Took the long way round (first time using RegEx), but got there.

Alteryx Certified Partner
Alteryx Certified Partner

As others have said this is a great exercise for working on improving your regex skills.

 

Here's my solution.

 

Spoiler
dateparse.PNG

 

Ben

Alteryx Certified Partner

Took a while to understand that it's only the four formats in the instructions that have to be supported... Tried to build a solution for all dates I could think of before reverting to a more sensible approach. Thanks for the exercise!

Spoiler
I used a regex tool and then the BB-Date macro. It caught 3 of the 4, so I just added a comma (Jun 5 2000 >>> Jun 5, 2000) so that way BB-Date handled all of the dates.
Capture.PNG
Meteor

Had to peak at the solution for this one.  Excellent challenge.