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:
1 | A |
... | |
10 | B |
11 | C |
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?
Solved! Go to Solution.
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