Group examples together in a loop
Hello lovely community,
I am currently stuck with a problem of my data prep in RM and I am a bit in a hurry so please excuse my possible spelling mistakes. Here is my problem:

In the screenshot you can see a snippet of my data so far. I am working on a way to put my examples into a group of examples, where the last example of a group should be the one with the "Error Name" = Critical Error. You can see the group selection already in the attribute "session id-1", where the row 2-11 is connected to "session id-1"=0.
My problem now is that sometimes an Error occurred on the same time with an Critical Error, but it was written into the group after that Critical Error (as you can see in the first screenshot). Now I am looking for a way to include this event D, which has the same timestamp like the one of the Critical Error, into my first group.
This should be the result:

I thought about of getting the max timestamp of "session id-1" = 0 and compare it to the min timestamp of "session-1" = 1 to see if it the same or not but I have great troubles with the loops of RM.
Could somebody please help me?
Thanks in advance!
Greets,
Janito
I am currently stuck with a problem of my data prep in RM and I am a bit in a hurry so please excuse my possible spelling mistakes. Here is my problem:

In the screenshot you can see a snippet of my data so far. I am working on a way to put my examples into a group of examples, where the last example of a group should be the one with the "Error Name" = Critical Error. You can see the group selection already in the attribute "session id-1", where the row 2-11 is connected to "session id-1"=0.
My problem now is that sometimes an Error occurred on the same time with an Critical Error, but it was written into the group after that Critical Error (as you can see in the first screenshot). Now I am looking for a way to include this event D, which has the same timestamp like the one of the Critical Error, into my first group.
This should be the result:

I thought about of getting the max timestamp of "session id-1" = 0 and compare it to the min timestamp of "session-1" = 1 to see if it the same or not but I have great troubles with the loops of RM.
Could somebody please help me?
Thanks in advance!
Greets,
Janito