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.
Hi All! I'm relatively new to Alteryx, hoping this is an easy ask.
I have 200 excel files that I need to pull random samples from. I am looking for 10 random records from each file unioned together into one output file (so 2000 records total in the output). Is this something I'd use a macro for? All of the files are located in the same folder.
I'd recommend reading up on how to use a batch macro to pull in multiple files with multiple schema (assuming they have multiple schema). I do not know what you are doing with multiple sheets but that is often a consideration. The sample tool part is easy as you can just connect that prior to the macro output...
You only need a macro for this if the schema is different in any of the files. If they are the same, then you can use the following
Use a wild card to read all the workbooks from the directory. Add a random number to each row. Sort by filename and random number. Use a Sample tool to extract the first X records for each file from sorted dataset.