I am pretty new to Alteryx and trying to figure out how to do something and have no idea where to start. I've got a list of records with a Unique ID, Date/Time, Status, and Value. The Status can be either Pass or Fail. There might be 4 records that were a Fail, and then 1 or more that was a Pass. Or no passes.
Sample data:
Unique ID Date/Time Status Value
12345 1/1/2021 14:00:01 Fail 5
12345 1/1/2021 14:00:02 Fail 5
12345 1/1/2021 14:03:07 Fail 5
12345 1/1/2021 14:05:01 Fail 5
12345 1/1/2021 14:06:00 Pass 5
12345 1/2/2021 12:00:00 Pass 5
12345 1/3/2021 13:05:01 Pass 5
I want to match the fail records to the next passing record that shares the same Unique ID and value. If it passed by the end of the following day, then it's good and a "match". So like in this example, the desired output would look like this:
Unique ID Date/Time Status Value Match Status Matching Unique ID Matching Date/Time Match Status Match Value
12345 1/1/2021 14:00:01 Fail 5 Match 12345 1/1/2021 14:06:00 Pass 5
12345 1/1/2021 14:00:02 Fail 5 Match 12345 1/2/2021 12:00:00 Pass 5
12345 1/1/2021 14:03:07 Fail 5 No Match
12345 1/1/2021 14:05:01 Fail 5 No Match
The output could also be like this if it's easier.
Unique ID Date/Time Status Value Match Status
12345 1/1/2021 14:00:01 Fail 5 Match
12345 1/1/2021 14:06:00 Pass 5 Match
12345 1/1/2021 14:00:02 Fail 5 Match
12345 1/2/2021 12:00:00 Pass 5 Match
12345 1/1/2021 14:03:07 Fail 5 No Match
12345 1/1/2021 14:05:01 Fail 5 No Match
12345 1/3/2021 13:05:01 Pass 5 No Match
The goal is just to be able to identify which fail records didn't have a pass that occurred after the fail but before the end of the next day, but being able to see the details of which record matched to the fail would be nice (hence the 1st sample output which I like)
Was thinking to do something like.. filter the fails to their own group, filter the passes to their own group, and then do a join on Unique ID, Value. But the date thing is throwing me for a loop (The pass can only show as a match if it's 1) after the fail and 2) by the end of the next day), and the other thing is that each pass can only show as a match one time ever - so after it is a match for something, it has to be removed from being considered for other matches. It's like I need to look at my Fail data, and for each Fail record, iterate through each Pass to see if it's a match, and if it is, remove it from the Pass list and then continue on through my list of Fails or something. I might be thinking about this wrong though.
Am a little bit lost at how to go about this so any help or direction would be appreciated!
Thanks