We've recently made an accessibility improvement to the community and therefore posts without any content are no longer allowed. Please use the spoiler feature or add a short message in the message body in order to submit your weekly challenge.
2022.1.1.30569 Patch Release Update

The 2022.1.1.30569 Patch/Minor release has been removed from the Download Portal due to a missing signature in some of the included files. This causes the files to not be recognized as valid files provided by Alteryx and might trigger warning messages by some 3rd party programs. If you installed the 2022.1.1.30569 release, we recommend that you reinstall the patch.

Weekly Challenge

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

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

We're actively looking for ideas on how to improve Weekly Challenges and would love to hear what you think!

Submit Feedback

Challenge #312: Hours, Minutes and Seconds

chiomaisaiah
6 - Meteoroid
Spoiler
chiomaisaiah_0-1648752074430.png

 

NicoleJohnson
15 - Aurora
15 - Aurora

Solved two ways! The long way, and the "one tool solution" way. 😁

 

Spoiler
The long way uses some of the traditional parsing tools to split the time into 3 parts, filter out 0 time, and apply the Hours/Minutes/Seconds labels before concatenating back together.

The "one tool solution" way, on the other hand, uses some nested formulas to strip out the time components (as long as they are not 0), string them together, and then remove any extra/unnecessary spaces.

NicoleJohnson_0-1648757988904.png

Here's the one-tool formula I ended up using!

TrimLeft(
Replace(
If IsEmpty(TrimLeft(left([Chat Time],2),"0")) Then Null() Else TrimLeft(left([Chat Time],2),"0") + " Hours" Endif

+ " "
+ If IsEmpty(TrimLeft(Substring([Chat Time],3,2),"0")) Then Null() Else TrimLeft(Substring([Chat Time],3,2),"0") + " Minutes" Endif

+ " "
+ If IsEmpty(TrimLeft(Right([Chat Time],2),"0")) Then Null() Else TrimLeft(Right([Chat Time],2),"0") + " Seconds" Endif
," "," ")
)

Cheers!

NJ

MJ
8 - Asteroid

No need for that 2nd input of lookup values :)

Spoiler
MJ_Solution.png
Michael_Draper
7 - Meteor

Took a shot! Probably a better way to do it, but I 

Spoiler
converted string to number and back to string to get rid of leading zeros

 

Spoiler
Michael_Draper_1-1648766809512.png

 

Michael_Draper_0-1648766792637.png

 

G_Thompson
8 - Asteroid

Here's my answer!

VizChic
10 - Fireball

First time back in Alteryx for a while, so starting off slow :)

Pang_Hee_Choy
9 - Comet

one formula tool, 

 

datetimeformat

regex_Replace to remove 00 and leading 0.

Spoiler
Pang_Hee_Choy_3-1648802827751.png

 

Pang_Hee_Choy_2-1648802770574.png

 


 

 

RolandSchubert
16 - Nebula
16 - Nebula
Spoiler
312.jpg
JereJussila
8 - Asteroid
Spoiler
JereJussila_1-1648814100025.png

 

Had to give it a go also with Regex, capture groups to the rescue

Powerhouse_21
7 - Meteor
Spoiler
Powerhouse_21_0-1648824082847.png