Alteryx Designer Desktop Discussions

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

One to many: Joining a transaction table to a territory lookup table

jmorris24
7 - Meteor

Hello,

 

I have a transaction table that has the following data

Transaction IDAmountCountryType
155USAsoftware
2100USAsoftware
3300Germanysoftware
4500Switzerlandsoftware
4250Switzerlandhardware
5600Japansoftware
5300Japanhardware
6500USAsoftware
7300Japansoftware

 

Then I have a lookup table:

Territory IDCountryRegion
1USAAMER
2GermanyEMEA
3SwitzerlandEMEA
4JapanAPAC
5ChinaAPAC

 

I need to add a column to the main table (transaction table) data called Region. When I go to join the lookup table to add Region in by State I go from having around 3k records in the main table to then having 10k records in the join table. I know why this is but I can't find any information on what to do about it. 

 

I need the main table to have the same number of rows it started with just with the region add in.

 

Please help...

5 REPLIES 5
AngelosPachis
16 - Nebula

Hi @jmorris24 ,

 

Can you try using a Find/Replace tool instead and select to append the records field as shown below?

 

Screenshot 2020-10-21 214918.jpg

 

 

jmorris24
7 - Meteor

Thank you. Thank you. Thank you. I should have ask 2 hours earlier. That was really easy. 

AngelosPachis
16 - Nebula

I wasn't 100% sure that it will work so we both learned something new 🙂

 

Thanks for asking @jmorris24

AIChudnovsky
7 - Meteor

When you join to the lookup table, the field you're joining from the lookup table needs to have unique records, otherwise it will join every record that matches and thereby multiplying the amount of output records for each duplicate entry in the lookup table.  Whereas Excel's vlookup function only displays the first match, Alteryx will display all matching records.  A quick way to solve for this is to add a Unique Tool to your lookup table before the Join Tool.

jmorris24
7 - Meteor

My lookup table was as unique as it could have been already. The solution suggested above worked great for my use case. You can't always make things unqiue. sometimes you need the data that is there. 

 

Cheers!

 

Labels