Alteryx Designer Desktop Discussions

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

Join based on fields with the most matches

Noorakroush
7 - Meteor

Is there a way to join two data streams by checking first which field will give the most matches and then doing the join? 

 

I have two data sources, the first time I join on say CustomerID i get 79 matches, but when I match on FileID i get 92 matches, but this will not always be the case with all my reports, I want a way to check first then use the join field on either CustomerID or FileID depending on which will join more records

 

Thanks

3 REPLIES 3
fmvizcaino
17 - Castor
17 - Castor

Hi @Noorakroush ,

 

I'm not aware of a direct way of doing that, so I'm attaching my example here.

Let me know if this works for you.

fmvizcaino_0-1594183576237.png

 

 

Best,

Fernando Vizcaino

Noorakroush
7 - Meteor

This worked perfectly! Thank you so much 

seven
12 - Quasar

Hi @Noorakroush 

 

I mocked up an example. Since you don't know which field will give more matches, you can verticalise them into one field, perform a join, test the join with the summarize tool, rejoin on the field with more joins dynamically, and pivot back to the original structure. I used a generate rows and formula tool combo to simulate a second input file in which the proportions of these fields will join and now each time you run the example, it can potentially join on one or the other field, just like you asked.

 

seven_0-1594186955108.png

 

This method does not require any manual testing and you will not have to run it multiple times to test any fields.

Labels