Hello to all. I have a time table (new_ita9TT) that contains data from different motion sensors. The column called Column1streamId contains the names of the sensors; the column called Column1type contains the type of rule (in this problem, I'm interested in door / open and door / closed). The analysis I want to do is as follows: I go to see the first door / closed that is in the Column1type column, referred to the sensor called dbuid-3; then I go to look for the following door / open (again referred to the dbuid-3) e - if there are no other lines between the door / closed and the door / open of the dbuid-3 and their time difference (which is in the ColumnDateTime column) is greater than 20 minutes, then save the data in a new table which will correspond to the patient left out of the house; - if between the door / closed and the door / open (again referred to the dbuid-3) there are other lines, then save this data in another table which will correspond to the patient at home.
Warning: the door / closed and the door / open can also be referred to other sensors, so it is important to specify the name of the sensor that interests me, ie dbuid-3; it is also important to start from the door / closed (of the dbuid-3) and since surely before the door / closed there will be a door / open, this door / open do not want to consider it.
Can someone help me?