Joiner within a specific time frame

Hi @amirmbhd, some alternatives that don’t use the left outer joining, but instead make some assumptions about the sequencing of your data, as there appeared to be no guarantee that we could match on date, and needed to have some idea of how data in one row compared with data in the other (other than just the order number)

So there were a couple of question marks I had over whether your data rows were always in the exact same sequence, so I did a variety of flows to demonstrate different approaches. The very first flow I did was assuming you actually wanted to filter out the rows that weren’t matching within the time window, and demonstrates what you might do in that situation, but the subsequent flows give back the data that you want, and provide ideas on what to do if the ordering of rows isn’t quite the same, in increasing order of complexity.

I also noted that your date/times weren’t always consistent. Not sure if that was just typos, but the flows handle that too

Joiner within a specific time frame.knwf (85.7 KB)

The one at the end purposely shuffles the input tables , then ranks them in ascending date order by order number before then comparing based on order number and rank. The other ideas are pretty much as @morpheus has proposed. I use a Date&Time shift instead of a date&time difference, but the principle of what it’s doing is the same.

(as you can see from the interest this has sparked, there are many varieties of solution from different people, and hopefully each gives some useful insights and tips that can assist you., Oh and don’t apologize for writing a long post… We’d always rather have clear requirements and a good explanation, as it helps us find a solution! :slight_smile: )

2 Likes