Challenge #4: Date Parsing
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
KOBoyle
11 - Bolide
06-12-2017
08:23 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Philip
12 - Quasar
07-03-2017
07:45 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Weekly challenge 4 done.
Spoiler
Formula tool:
IF REGEX_Match([Field_11], "\d+-\u{3}-\d{2}")
THEN DateTimeParse([Field_11], "%d-%b-%y")
ELSEIF REGEX_Match([Field_11], "\d+-\u{3}-\d{4}")
THEN DateTimeParse([Field_11], "%d-%b-%Y")
ELSEIF REGEX_Match([Field_11], "\d+-[\u\l]+-\d{4}")
THEN DateTimeParse([Field_11], "%d-%B-%Y")
ELSEIF REGEX_Match([Field_11], "[\u\l]{3} \d+, \d{4}")
THEN DateTimeParse([Field_11], "%b %d, %Y")
ELSEIF REGEX_Match([Field_11], "[\u\l]+ \d+ \d{4}")
THEN DateTimeParse([Field_11], "%B %d %Y")
ELSE NULL()
ENDIF
Formula tool:
IF REGEX_Match([Field_11], "\d+-\u{3}-\d{2}")
THEN DateTimeParse([Field_11], "%d-%b-%y")
ELSEIF REGEX_Match([Field_11], "\d+-\u{3}-\d{4}")
THEN DateTimeParse([Field_11], "%d-%b-%Y")
ELSEIF REGEX_Match([Field_11], "\d+-[\u\l]+-\d{4}")
THEN DateTimeParse([Field_11], "%d-%B-%Y")
ELSEIF REGEX_Match([Field_11], "[\u\l]{3} \d+, \d{4}")
THEN DateTimeParse([Field_11], "%b %d, %Y")
ELSEIF REGEX_Match([Field_11], "[\u\l]+ \d+ \d{4}")
THEN DateTimeParse([Field_11], "%B %d %Y")
ELSE NULL()
ENDIF
JORGE4900
8 - Asteroid
07-13-2017
12:25 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I really enjoyed working on this solution because I appreciate the advantages of regular expressions. On my first try, I did a long version of columns using additional regex tools; on my second try, I used a slightly different approach with a single regex tool. Somehow on this last try, I ended up parsing a T on column 6.
I guess that I should have used the two or more digits option instead of forcing the two and four digit year onto their own columns.
JORGE4900
8 - Asteroid
07-13-2017
01:51 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
That was a pretty good solution @MarqueeCrew
nick_ceneviva
11 - Bolide
08-01-2017
12:26 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
16 - Nebula
08-05-2017
03:55 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
20 - Arcturus
08-05-2017
04:00 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks for the mention!
Alteryx ACE & Top Community Contributor
Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Amarendra
10 - Fireball
08-06-2017
05:56 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
This link from @AlexKo helped me understand the 'RegEx' Thank you Alex for such a comprehensive resource.
Attached is the 4th challenge solution.
dheerajpoojari
7 - Meteor
08-17-2017
09:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
My solution attached. was a good refresher to regex
derekbelyea
12 - Quasar
08-19-2017
01:28 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator