Alteryx Designer Desktop Discussions

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

Lookup field in second data source and return value from second column

datadabbler
7 - Meteor

What is the best way to solve the following problem? I have data source one with many columns, one of which is "City" which is filled, another is "Area Code" which is empty. I have a second data source which is two columns "templateCity" and "templateAreaCode". I want to fill "Area Code" with the "templateAreaCode" matched on "City" to "templateCity". I can use Find and Replace tool, but that overwrites a columns data (I think?!), I need to fill "Area Code" with the corresponding city area code?  Thanks.

4 REPLIES 4
CarliE
Alteryx Alumni (Retired)

Hi @datadabbler,

 

Is there a dummy dataset you can attach? What i think you will want to do is use a join tool rather than a find and replace.

 

This is what I was thinking

CarliE_0-1667836710680.png

 

 

If this helped to solve your issue, please make sure to mark it as a solution!

Carli
gautiergodard
13 - Pulsar

Hello @datadabbler 

Would you be able to use the join tool for this?

I've mocked up a quick example to get you started.

gautiergodard_0-1667836803399.png

 

DataNath
17 - Castor
17 - Castor

You can use Find & Replace for this, you just need to use the 'Append Field(s) to Record' option instead of the 'Replace Found Text With Value' selection:

 

DataNath_0-1667836851012.png

 

However, @CarliE's solution here is definitely better as the Join tool has built in Select functionality so you can clean up field names and remove the unnecessary ones without adding a separate Select tool that you'd have to do with the F&R approach.

datadabbler
7 - Meteor

I used the F&R followed by the Select tool and that produced the desired results. The Join tool did work, but it changed/broke the output file column order. I am trying to figure out why, as it probably is the neater solution. Anyhow, thanks all.

Labels
Top Solution Authors