I'm using Alteryx to compare two data sources for similarity and I'd like to automate the process of setting the "Join by Specific Fields" in the Join tool. The workflow itself is pretty simple and I've attached an example. Manually configuring the join fields can be quite time-consuming depending on table size, and I would like to automate a solution.
Is there a way to automate this configuration using Alteryx's API, a script, or any other method? Any guidance, sample code, or references to documentation would be greatly appreciated.
Attached is an example of what I'm using.
Assuming you mean single field to single field - the easiest way to accomplish this is via a batch macro where you use a dynamic rename before the join tool. your dynamic rename is set up with the formula:
if [_CurrentField_]='TEST' then 'DummyFieldName' else [_CurrentField_] endif. you then attach an action tool and set this up to replace the specific string TEST. Look on the bottom of the action tool to configure this.
connect a batch macro to your join.
replace on the other side of your join.
Join DummyFieldName to DummyFieldName (note - you will need to feed in some sample data and a dummy field named TEST to get this to work).
user interface designer to configure union by name.
deploy as batch macro.
Note if you have potentially one to many/many to many - I wrote about how to solve this via using dynamic select and transpose a few months back. search around for it.
User | Count |
---|---|
91 | |
79 | |
62 | |
36 | |
36 |