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 #106: How Long were the Lights On?

Vidya26
8 - Asteroid

My Solution!!

garthn555
8 - Asteroid
Spoiler
106.png
ZenonH
8 - Asteroid

I'm surprised that you can't use some DateTime functions on 'Time' only data, but it does make good sense and practice to always have a date associated with your data and then change your type at the end (:

Spoiler
ZHWF.PNG
alex
11 - Bolide

same as most

Laszlo_D
8 - Asteroid

clipboard_image_0.png

rougeau14
6 - Meteoroid
Spoiler
clipboard_image_0.png

I learned so much about date-time functions and the generate rows tool while doing this challenge. Definitely an interesting problem to solve!

OllieClarke
15 - Aurora
15 - Aurora

Nice

Spoiler
challenge 106.png
kjolly96
5 - Atom
Spoiler
clipboard_image_0.png
SueDonim
8 - Asteroid

Definitely made this one harder than it needed to be ([Insert Michael Scott comment here]).  Thought the general solution was wrong for quite a while, but, surprise, found out the error was mine.

 

Need to study the other solutions as I can see they are much simpler (though not keen on the brute force Generate Rows idea)

 

Spoiler
Process:
- Convert times to useable format
- Sort by room, then by entry, then by exit
- Calculate time in room (without considering duplicates)
- Calculate overlap time in room in one direction (i.e. 2nd entry before first exit)
- Calculate overlap time in room in other direction (i.e. 2nd exit before 1st exit) - this is the step I overlooked initially
- Grouped each figure by room and added the three times (in the three steps above)
- Joined data
- Subtracted difference in overlap times from total time (i.e. Total - (Overlap 1 - Overlap 2))
- Cleaned up data

MySolution.PNG
varunvarma87
8 - Asteroid

Challenge Completed !

Spoiler
2019-10-14 15_44_49-Alteryx Designer x64 - challenge_106_start_file.yxmd_.png