Calling all Alteryx customers: Refer your colleague to try Alteryx and receive a $50 gift card. Sign up now!
Free Trial

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 #316: Blowing in the Wind - Part 1

Erin
10 - Fireball

I always try to avoid RegEx - but can't - and then have to spend time figuring it out. 😐

AGilbert
11 - Bolide

Love some regex practice.

 

lwolfie
11 - Bolide

Great parsing exercise

danbostrom
8 - Asteroid

 

 

Bobbyt23
12 - Quasar

Lovely bit of Regex to sort the data. Ooof.

aiahwieder
8 - Asteroid

The answer, my friend . . .

cmoussa
8 - Asteroid

WF.png

 

robert-headington
8 - Asteroid

#316

Suresh_batchu
8 - Asteroid

Solved !!

 

316 Snippet Solution.png

Bennu
8 - Asteroid

The hardest parts are the RegEx:

 

Spoiler
(.*)\s+(\d+) MPH\s{3,10}(.*)\s{3,10}(.*)

followed by the parsing of the time:

Spoiler
if contains ([TimeDate],'AM') then
if tonumber(left([TimeDate],2))= 12 then
"00"+":"+Substring([TimeDate],2,2)+":00"
else
left([TimeDate],2)+":"+Substring([TimeDate],2,2)+":00"
endif
else
if tonumber(left([TimeDate],2))= 12 then
left([TimeDate],2)+":"+Substring([TimeDate],2,2)+":00"
else
tostring(12+ tonumber(left([TimeDate],2)))+":"+Substring([TimeDate],2,2)+":00"
endif
endif

Final solution:

Spoiler
WC_316.jpg