MySQL Forums
Forum List  »  General

Removing "noise"
Posted by: Daniel Proctor
Date: February 13, 2018 01:00PM

I'm working with some RTLS data that is tracking employee movement in and out of rooms. There's a lot of extraneous rows where the system shows the employee in the room, then out in the hall (a null room) then back in the room.
Ex:
employee ID Room time in time out
19 101 7:00:00 7:00:45
19 null 7:00:45 7:00:55
19 101 7:00:55 7:02:00

I'd like to collapse the rows into one so it shows
employee ID Room time in time out
19 101 7:00:00 7:02:00

The logic would be
1) if the next row is for a null room and time in - time out is less than 60 seconds
2) and the next row after that is for the same room

then - remove those two rows and change the first rows time out to the time out for the third row

There are several thousand records a day being generated so there are also cases where the system might show the employee in and out of the same room for several times.

Not really sure how to approach this and any help would be appreciated.

Options: ReplyQuote


Subject
Written By
Posted
Removing "noise"
February 13, 2018 01:00PM
February 13, 2018 01:19PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.