Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Flight Match of the closest date using a record only once

QVC
6 - Meteoroid

I am trying to figure out the logic in which to match inbound flights to the closest outbound flight, but the outbound flight can only be used once.  Is there a way to do this in Alteryx? 

 

Below is the output in which you can see that Outbound_RecordID 11 is used twice to match two different inbound flights twice.

 

Results_v2.JPG 

 

 

I have attached the two tables as well as the workflow

 
 
2 REPLIES 2
BenMoss
ACE Emeritus
ACE Emeritus

I believe you will need an iterative macro to perform this task.

https://www.thedataschool.co.uk/marc-reid/creating-iterative-macro-alteryx/

I've built out an example with your data that I believe brings you to the solution you would like, see attached.

Basically the way it works is it takes your data through, takes the first match and pulls that through to keep, it then removes any instances of that inbound ID, and then instances of that outbound ID, which gives us a new dataset (now excluding the potential for duplicates) which comes back round to the front, and the process loops.

Ben

QVC
6 - Meteoroid

Ben,

 

This is pretty awesome.  I will definitely be reading up on Iterative Macro. 

 

Thank you so much!!

Labels
Top Solution Authors