Hello, I'm using Alteryx to generate a mapping file in Excel which will be updated every time I re-run my workflow. I only see options to drop (delete) the Excel Table or Append it however I only want to append new records. What's the simplest way to do this with the least manual intervention in my workflow? Thanks.
Solved! Go to Solution.
Hey @mattlukoff - I've attached the macro to this, and explained how it works below- I think that this does what you need, but please do check and verify.
Hopefully this solves your problem - if so, would you mind marking as solved? If not, feel free to come back on this thread and we'll continue to iterate until we get you to your solution.
Cheers
Sean
Thanks @SeanAdams. I get where you're going with this but the issue I'm having is that any mapping file is always the result of the data input. So if there are new entries in my data I'm stuck with creating multiple joins off of existing mapping files to new mapping files. My goal is simply to Append the new records to one Mapping File in Excel. The current Append function Appends ALL data again which is what I'm trying to solve around.
Hey @mattlukoff
I must apologise - I'm not quite following what you mean - are you able to extend your example to include the problem you're having that's causing you to have to do multiple joins?
keen to see if we can get you to a solution that meets your needs - the closer to the actual case you can make the example, the closer we can get to a solution.
Cheers @mattlukoff
Sean
@SeanAdams,
Thanks again for staying on this! The problem was as posted in my workbook. Desired solution is to have just one Mapping file in Excel which gets updated with *only* the new records from my data. Doing an Append puts *all* records into the Excel. I also don't want to loose the info I add manually in the Excel which is why a Drop won't work.
EDIT: Updated Files
@mattlukoff Try the attached workflow. Make sure to save the macro to the same folder before you run the workflow. Here are the macro inputs:
The file browse is where you point to your mapping file. It currently will only support xlsx files.
The list box is where you check which fields from your incoming data stream need to join to your mapping file. It should support more than 1 field, but I haven't tested that :)
As for the Macro, it's a little tricky trying to set it up dynamically:
It basically takes your incoming Alteryx stream (Macro Input) and Joins it to your mapping file in the join. It takes whatever isn't already in the mapping file (comes out the L join) and groups it by your key fields. Then it appends just those new fields to your mapping file.
Hope this points you in the right direction!
@patrick_digan, thanks for the attempt. I do think this can be accomplished through a macro but I don't have enough skill building them yet. I used the one you provided and changed every file path for my local machine, the macro runs without error but the mapping file doesn't get updated. I'm assuming the one you tested worked fine?