Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

Batch Macro Join?

Alteryx Partner

It would take too much time to pull out all the sensitive data out of the macros to post them directly, but I can describe what I did.


First, I had to choose a specific number of files to limit the joins as I  could not dynamically have any number of files - I chose 9 for my purposes.


There's three layers of macros that I'm using. The innermost macro is simply a dynamic left join that uses an Action tool with "Update Raw XML with Formula" option to change the key that the join tool is using followed by union. (See picture - join macro)


The next layer is fairly complicated, but it uses a Control parameter with a detour tool and a number of formula tools to configure the join macro based on the filename. If it was passed no name, it would just run pass the records through the bottom detour and turn off the container with the join. If a filename was given, it would parse it to build the XML to go into the join macro (our input files had a consistent naming convention). (See picture - middle join)


The outermost layer was simply a cascading chain of the previous macros with each one being fed one or zero files from a list of files. (See picture - top join)