This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
It's the most wonderful time of the year - Santalytics 2020 is here! This year, Santa's workshop needs the help of the Alteryx Community to help get back on track, so head over to the Group Hub for all the info to get started!
I have created a workflow that is very delicate and needs to process one file at a time regardless of schema in order to avoid errors. I have created a directory of my input files and have a formula set up to ensure that once a file is processed it moves on to the next one (just by removing prefix from output file and then removing where they duplicate and selecting first of the remaining files). The processing time is not lengthy but it is a pain to have to keep pressing "Run" every time rather than looping back and going again if I have a very large number of files.
This seems likely to be very solvable but haven't managed to find a solution through the search.
You've probably tried this already, but if you have a list of the filenames of all the files you need to process, you can feed that into your macro using a control parameter (attached to an action that updates the filename). This will run your macro as a "batch macro", so it will run the macro for each record in the input you feed into the control parameter. Without knowing any more about your specific use case it's hard to say anything more specific. One trick I've found for getting around schema issues is to just attach a record id and transpose using that as the key so that, regardless of file, the schema you feed in/out of your macro is just "record id, name, value".
You might find the attached macro useful.....I built it while trying to figure out a similar problem. Basically, how it works is the individual filenames in the workflow are fed into the macro using a control parameter tool, which is attached to an action that updates the filename for a file input tool. The batch macro will run through once for each input fed into the control parameter, and union the results for output. In this case all the batch macro does after input is pivot the data to maintain the same schema for outputs, but you could do other computations inside the macro.