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.

How do I join County + State + Zip Code properly?

rively90
8 - Asteroid

Context: I want to perform left joins, but there are 2 PK that need to be satisfied such as : County and State

 

Reason: If I only have County as my PK, it seems wrong because one county can be in multiple states.

For example: Orange County, Ca . Orange County, FL. etc...

 

My main data is in the left table (Sample.csv) and the US zip as the right table

 

I want to bring the ZIP Code and City from Uszips file to Sample.csv

I already tried my best to join them. But, not sure if it's right? or maybe I'm over thinking it?

 
 

 

I hope someone can clarify this, thank you!

 

6 REPLIES 6
Qiu
21 - Polaris
21 - Polaris

@rively90 

In the example below, 

For combination of Alabama and Autauga, it has multiple records in both of your input files.

When we do join, it will generate 7x 3 = 21 records.

So how would you like to bring the City and Zip back to Sample.csv, maybe in a concatenaced format?

0921-rively90-A.PNG0921-rively90-B.PNG

rively90
8 - Asteroid

@Qiu  so what should I do exactly? step by step?

Would you want me to concentenate County + State and make it as PK?

rively90
8 - Asteroid

@Peachyco  Hi, do you know if the multiple joins can be used to solve this problem?

Qiu
21 - Polaris
21 - Polaris

@rively90 
The question here is what do you want your output looks like?

Since we are joining State and County so there will be multiple City and Zip for each unique combination of State and County.

rively90
8 - Asteroid

@Qiu  Can we use unique filter? no?

Qiu
21 - Polaris
21 - Polaris

@rively90 
it mean you are ok to choose one random value of City and Zip for each unique combination of State and County.?

Labels
Top Solution Authors