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

General Discussions

Discuss any topics that are not product-specific here.
SOLVED

Help with a difficult request

RaptorZ
6 - Meteoroid

I have a file that has multiple fields, there are 7 fields on this file (randomly populated) that are to be used to match to another file that contains all 7 fields (fully populated) once matched I bring back the data from other fields in the 2nd file.   So for example see attached.

any thoughts help would be greatly appreciated

5 REPLIES 5
RaptorZ
6 - Meteoroid

I believe it's called an index match function in excel

 

Yoshiro_Fujimori
15 - Aurora

I don't know what is "an index match in excel", but if you want to match all 8 records, you would need to define which keys are potentially used to join.

Assuming any record should match either 

[City] + [state] 

or

[zip],

you may want to join twice and union the output as below.

Join_Union.png

 

Output

CitystatezipdogscatsburgerpizzaCODE
Dallas 71253 vnn1
ChicagoIL60001y yy46
 MA20023nryy125
New York 51506y yy406
  50608y   946
BostonMA20203y ny356
DenverCO n  n64
AtlantaGA n yn98

 

I hope this helps.

RaptorZ
6 - Meteoroid

Thank you for your response, I am certain I am not doing a great job explaining this, but perhaps this is a better way to explain:

 

all 7 fields are primary keys, and what has been proposed was to provide me at least 2 of the 7 (sometimes it could be more) and it may be in the example above just Pizza and Burger that is filled in, so there's potential to bring back multiple "CODE" values for that line.   example being Burger and Pizza = y  so I'd bring back for that line 46 , 125, 406 as the appended values

my real life ask is a file of 1000s of records with different combinations of 7 fields, to match to a file that has all 7 fields fully filled in, to get another field value to append to the partially filled in line (which again may have multiple values returned b/c they're rarely ever providing all 7 fields)

Yoshiro_Fujimori
15 - Aurora

@RaptorZ ,

So if the field is empty, that means a wildcard.

You would need to evaluate each row in "Fully filled table" if it matches with each row in "Partially filled table".

You can do it with batch macro or Append Field tool.

 

The Append Field tool may cause Error if the Partially filled table has more than 16 records.

(You can change the tool configuration to allow it.)

 

Here is a sample workflow. I hope it helps.

 

Apparently the repetition of Filter Tool is not scalable in design.

But it works enough if there are only 7 key fields to compare.

If you want to make it more scalable, please try it when you have time.

 

Input Data

Partially filled table (last two rows are added for test of multiple match)

citystatezipdogscatsburgerpizza
ChicagoIL60001y yy
New York 51506y yy
 MA20023nryy
BostonMA20203y ny
AtlantaGA n yn
DenverCO n  n
  50608y   
Dallas 71253 vnn
     yy
 MA     

 

Fully filled table (same as original)

citystatezipdogscatsburgerpizzacode
deaconMA20023nryy125
BostonMA20203yVny356
SacramentoCA50608yXYN946
New YorkNY51506yYyy406
ChicagoIL60001yYyy46
Dallas 71253yvnn1
AtlantaGA35065nYyn98
DenverCO75606nYyn64

 

Workflow

partialMatch.png

Output Table

 

RecordIDcitystatezipdogscatsburgerpizzacodes
1ChicagoIL60001y yy46
2New York 51506y yy406
3 MA20023nryy125
4BostonMA20203y ny356
5AtlantaGA n yn98
6DenverCO n  n64
7  50608y   946
8Dallas 71253 vnn1
9     yy46,125,406
10 MA     125,356
RaptorZ
6 - Meteoroid

Brilliant, I will try this when I return to work and let you know, but i believe this is the solution!  and barring no errors or issues I will mark as accept as solution tonight   Thank you sir!!!

Labels
Top Solution Authors