Challenge #106: How Long were the Lights On?
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Last week's solution can be found here:
This week, we have a simple data set that represents times that inhabitants enter and exit rooms within their household. Assuming inhabitants have the lights of the room on whenever they are present and off when they are not (think motion detection), how many minutes were lights on in each of the rooms?
Note: If there are overlapping time entries, assume the light is on as long as someone is present in the room.
Example: Person 1 is in the room from 12:30 PM - 1:30 PM, and person 2 is in the same room from 1:00 PM to 2:00 PM. The amount of time the light was on was from 12:30 PM to 2:00 PM (do not count duplicate time).
- Labels:
- Advanced
- Basic
- Data Analysis
- Preparation
- Transform
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Trickier than I thought until I realised that DateTimes would be easier to work with than Times. Managed to solve this with two tools in the end:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Here is my totally overcomplicated solution, just because
Could also do it in two tools but then my already hard-to read formula in multi-row tool would be even worse, so I decided to leave 3 tools.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Here's my pass at it!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I guess it's one of those times where the straight forward solution wasn't coming to mind...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Solution attached.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator