community
cancel
Showing results for 
Search instead for 
Did you mean: 
Do you have the skills to make it to the top? Subscribe to our weekly challenges. Try your best to solve the problem, share your solution, and see how others tackled the same problem. We share our answer too.
Weekly Challenge
Do you have the skills to make it to the top? Subscribe to our weekly challenges. Try your best to solve the problem, share your solution, and see how others tackled the same problem. We share our answer too.
Unable to display your progress at this time. Please try again a little later, or contact an administrator if you continue to see this error.
Getting started with Designer? | Start your journey with our new Learning Path!

Challenge #10: Date Time Calculations

Asteroid

Challenge completed with just the formula tool.

Spoiler
Formulas:
Days: DateTimeDiff([Time_Now],[TIMESTAMP],'days')
Hours: DateTimeDiff([Time_Now],[TIMESTAMP],'hours')-([Days]*24)
Minutes: DateTimeDiff([Time_Now],[TIMESTAMP],'minutes')-([Days]*24*60)-([Hours]*60)
Seconds: DateTimeDiff([Time_Now],[TIMESTAMP],'seconds')-([Days]*24*60*60)-
([Hours]*60*60)-([Minutes]*60)

Week10Challenge.png
Alteryx Certified Partner

Solution;

 

Spoiler
Weekly Challenge 10.png
Alteryx Certified Partner

Solution attached.  Used the same single formula tool with DateTimeDiff function used by several others.

 

Ken

Asteroid

Got it!

Spoiler
(Once I adjusted my 'time now' to match the output file value!)
Meteoroid

My solution using formula tool.

 

Spoiler
DateTimeDiff([Time_Now],[TIMESTAMP],"days")
DateTimeDiff([Time_Now],[TIMESTAMP],"hours")-Days*24
DateTimeDiff([Time_Now],[TIMESTAMP],"minutes")-(Days*24*60)-Hours*60
DateTimeDiff([Time_Now],[TIMESTAMP],"seconds")-(Days*24*60*60)-Hours*60*60-[Minutes]*60

 

Asteroid

Easy one.

Asteroid

Done; this seemed too easy.

Alteryx Certified Partner

Solution attached

Asteroid

Wow, I probably went with 4 different methods of trying to match the output before realizing there was a difference between the two files. D'OH! 

 

Anyway, great learning experience and I was able to solve with using just a formula tool!

 

Solution Attached!

Asteroid

 

Hi

 

Thanks for challenge I have since used these formulas to calculate times between.

 

I am struggling with my calculation though , can anyone help?

 

For each completed assessment I have a unique ID, I then have a completed assessment start date and end date, start time and end time with the date time calcs for time taken. In some instances the time taken goes into the next day so the time might start at 10:00pm and end at 05.00am the following day , this is showing as negative (-) hours in the time difference.

 

In these instances the assessment start date and end date would be different.

 

Example

Assm ID Assessment Start   Assessment End   Time Start   Time End  Hours Minutes

123456   15-09-2016             15-09-2016            23:00            05:30       -17     -30

 

This should be 6 hours 30.

 

Also how can I combine my hours and minutes so when I am trying to sum the time taken to complete a assessment it sums both hours and minutes.

 

Thanks