This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
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.
We are currently experiencing an issue with Email verification at this time and working towards a solution. Should you encounter this issue, please click on the "Send Verification Button" a second time and the request should go through. If the issue still persists for you, please email email@example.com for assistance.
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).
I didn't want to use Generate Row tool, thinking that on a real size data generating every minute would create a massive dataset, also it seems like a direct solution and I was interested to find if there is another way. And of course it is with Alteryx!
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.
I'm not sure if my method is the most optimal or not - basically I created a distinct record for each minute that existed and then used a pair of summarize tools. You could also use a count_distinct and cut the second summarize.