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!

Weekly Challenges

Solve the challenge, share your solution and summit the ranks of our Community!

Also available in | Français | Português | Español | 日本語
IDEAS WANTED

Want to get involved? We're always looking for ideas and content for Weekly Challenges.

SUBMIT YOUR IDEA

Challenge #4: Date Parsing

DavidW
Alteryx Alumni (Retired)
Spoiler
Screenshot.png
David Wilcox
Senior Software Engineer
Alteryx
ccruzagosto
7 - Meteor

My attempt attached.

mpennington
11 - Bolide

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

 

 

 

JORGE4900
8 - 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
JeremyN
8 - Asteroid
 
SachinKotian
6 - 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
PaulN
Alteryx Alumni (Retired)
 
CliffordC
Alteryx Alumni (Retired)

Definitely not the neatest but it works.

Johnny_Analytics
8 - Asteroid
Spoiler
Challenge_4_solution.png
David-Carnes
12 - Quasar

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