Alteryx Designer Desktop Discussions

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

Add Data to a File by Matching a String

shaheer
8 - Asteroid

I have a file, let's call it file A, which has the following 5 fields:

 

IDNameCityFunded?Cost ($)
1Car theft preventionKansasYes100000
2Weapon UpgradesTorontoYes50000
...    
50FortificationsCharlottetown No250000

 

Let's say I have another file, File B, with the same 5 fields, but with over 5000 sets of data already in it. All of the ID's in file A are already in file B. I just need to make updates to the fields Funded? and Cost ($).

 

I've tried using a very simple approach using find and replace:

 

shaheer_0-1665774472614.png

 

However, this only appends them to file B (creates a whole new column). I want to replace/add the data from file A into the file B fields that already exist. Also, I do not know how to then overwrite file B after having used find and replace.

4 REPLIES 4
binuacs
20 - Arcturus

@shaheer If both the files are having the same ID then use the join tool to connect both files and make the changes. Attaching a sample workflow

 

binuacs_0-1665774944024.png

 

collin_pace
9 - Comet

Use a Join tool, join on ID.  Deselect Funded and Cost from the File B stream and keep them selected from File A stream - make sure no renames for the File A fields.  Then use an output tool to output to a new file.  I recommend writing out to a new file rather than writing over your existing File B, unless you're 100% your flow is working and you will never need to go back and reference original File B.  If possible, make a copy of File B, before you overwrite it if you really insist on the Output tool overwriting the existing file.

Oh, if you do set it up to overwrite the existing File B that you're reading in, you'll want to include a Block Until Done tool between Join tool and Output tool.

shaheer
8 - Asteroid

Can you explain why we uncheck the Funded and Cost columns in the join tool?

binuacs
20 - Arcturus

@shaheer Since you wanted to update the left table fields (Funded?, Cost) with table from the right, I deselected the values from and included only the fields from the right table, If you dont unselect them , you will values from both the tables

 

 

binuacs_0-1665783873872.png

 

binuacs_2-1665784112270.png

 

 

 

Labels