community
cancel
Showing results for 
Search instead for 
Did you mean: 

Weekly Challenge

Solve the challenge, share your solution and summit the ranks of our Community!
New content is available in Academy! You may need to clear your browser cache for an optimal viewing experience

Challenge #10: Date Time Calculations

Atom

A few more steps than others, but straightforward to troubleshoot...

Alteryx Partner
 
Asteroid

Cool challenge and good introduction to the DateTimeDiff function. 


I ended up using formulas where I took the difference between hours and then subtracted out [Days]*24. Got to the same place. 

 

Had a difference in seconds though, but when I do the calculation by hand, my answer seems to be correct, not what is listed in the text output. 

 

Interesting take though. Had to look up what a Modulo was when I compared my solution to the given solution. 

Alteryx Partner

Checked out some other solutions afterwards and really appreciate the diversity in approaches by others who have solved this.  And the bonus is that I learned about the modulo function!

 

 

Spoiler
challenge_10.png
Hours:  DateTimeDiff([Time_Now],[TIMESTAMP],'hours') - ([Days]*24)
Minutes:  DateTimeDiff([Time_Now],[TIMESTAMP],'minute') - ((60*24*[Days]) + (60*[Hours]))
Seconds:  DateTimeDiff([Time_Now],[TIMESTAMP],'second') - ((60*60*24*[Days]) + (60*60*[Hours]) + (60*[Minutes]))

 

 

Asteroid

Tested on both the Input and Output data since they seemed slightly different.

Alteryx Certified Partner

My solution :)

solution attached

Highlighted
Alteryx Partner

Solution attached. I went with a somewhat mathemical way.

Asteroid

1 tool. 4 formulas

Spoiler
Solution-Challenge 010.PNG
Asteroid

Soltuion attached.