Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Don't forget to submit your entry for the Excellence Awards by October 30! | Need more information about the program? Check out the blog here

How to write to a new file if Record ID is above a certain number?

8 - Asteroid

So I have a Batch Macro where I have an unknown number of records. If I have above X number of records I need to take all the records above X and put them into a different sheet. For example:




What I need is for the Records from 1 to 10 to go to one sheet and then all the records above 10 to go to a different excel file. How could I do this?


Can you use a filter tool where record ID <= 10


This would put the records 1-10 through the True and the 11 onward to the False. You could then connect this to another output data tool. 


Alternatively, you could use a formula tool that creates a new column called Sheet and say IF Record ID <=10 then "First Sheet Name" ELSE "Second Sheet Name". Then in the output data tool you could check the box at the bottom to take File/Table name from field and use this new sheet name column with the option Replace File/Table name. This would use the value in this new column that you created to generate sheets for the data that corresponds to these values. 


Example mock up