I´m trying to set up a workflow in order to copy the data from the file "Archivo de Copia" to then replace the data in the file "Archivo de Base". I´ve tried with Dynamic Select and Dynamic Replace tool but can´t figure it out. I was wondering if maybe it could be done with Run Command tool but since I´ve only been using Alteryx for a couple of months I´m not that skillfull in order to write the coding.
Any suggestions on this?
If I understand correctly, you have one file "base" which has existing data. and you want to bring in a new file "copy" and do these three things:
if a record is in base and not in copy, use the record from base
if a record is in both, use the new values from "copy"
if a record is in copy and not in base it is a net new record and use the record from copy.
The join tool is the perfect way to accomplish this. Bring in your base and copy and join them on the field of fields that define your unique record.
records that exist only in 'base" will come out of the right output. records that exist only in "copy" will come out of the left output and records that are in both will come out of the join output. Then uncheck the right elements in the join tool so that it is only bringing in the "copy" fields instead of the "base" fields for those join records.
Then union it together and write it out to your "base" file or the new file you want to create.
Attached the example workflow
Hi
Thanks for your answer. I´ve applied the workflow you attached in Designer and I´ve got a pair of questions:
- Is there a way to just replace the data in Base file with the copied data from Copy file, what I mean is just to copy the data without a specific condition and paste it in Base file...maybe a way to do this by rows (what I was trying to do with the Run Command tool was to copy rows range 2-100 and then paste them in Base file).
- Once the workflow has been run, how can I save the changes automatically in the .xlsx file, so that when I open the Base file again in Excel, the data has been updated.
Thanks!