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.
Announcement | Get certified today - take the Alteryx Designer Core and Advanced exams on-demand now!

Challenge #4: Date Parsing

Alteryx
Alteryx
Spoiler
Screenshot.png
David Wilcox
Senior Software Engineer
Alteryx
Meteor

My attempt attached.

Asteroid

Solution attached.

 

Spoiler
MP 4.png

Two sites that helped immensely with the RegEx I utilized (not sure why I bothered with spoiler tags three years later, but so be it):

https://www.boost.org/doc/libs/1_64_0/libs/regex/doc/html/boost_regex/syntax/basic_extended.html

https://regexr.com

This page helps a lot with dates:

https://help.alteryx.com/10.1/Reference/DateTimeFunctions.htm

 

 

 

Asteroid

Hello there @dataMack 

 

Here my second take on this solution. I submitted my first one in 2017.

 

Without taking a peak at the other's solutions, I knew that it could be done to use one single REGEX tool to extract the 6 different date formats in this weekly challenge. Once all those date formats have been extracted, the approach is to create a null date field and start date parsing the matched formats; thus, you can see that if a date parse has been executed by matching it, the following attempts are not executed because the date field would not be null anymore.

 

The approach to extracting the 6 different date formats has to be from longest to shortest; we would first need to identify and define a DD-MM-YYYY before a D-MM-YY in the REGEX tool; the formula date parsing would work on a similar fashion; it would first parse the longest matches before parsing the shortest matches.

 

Spoiler
2019-06-29_16-51-23.jpg
Highlighted
Meteor
 
Meteoroid

This was a really great challenge. Used the RegEx for the first time however i saw other solutions better than mine.

 

Spoiler
Capture.JPG
Moderator
Moderator
 
Alteryx Alumni (Retired)

Definitely not the neatest but it works.

Spoiler
Challenge_4_solution.png

I am comfortable enough with regular expressions to turn to them to solve the thorniest of string manipulation problems.  However, I always use the RegEx tool's expression builder with the dropdown to remind me of the syntax.  Parts of this are kinda ugly because I got stuck trying to do too many things with one expression.

Spoiler
004.png