Hi Community,
I have a data and I want to filter column A (Province) and set individual output files per province, without using multiple filter tools. Is there a way to put this into a macro function?
Province | Prod Code | Qty |
Alberta | AA | 100 |
Alberta | AB | 200 |
Alberta | AC | 300 |
Alberta | AA | 400 |
Alberta | AD | 500 |
Alberta | AA | 600 |
Alberta | AA | 700 |
British Columbia | AA | 100 |
British Columbia | EG | 200 |
British Columbia | IA | 300 |
British Columbia | BP | 400 |
British Columbia | BP | 500 |
British Columbia | BP | 600 |
Saskatchewan | WD | 100 |
Saskatchewan | WD | 200 |
Saskatchewan | WD | 300 |
Saskatchewan | WD | 400 |
Ontario | BA | 100 |
Ontario | BA | 200 |
Ontario | BA | 300 |
Ontario | BA | 400 |
Ontario | BA | 500 |
Ontario | BA | 600 |
Solved! Go to Solution.
Hi @Edgar_Ryan_C,
You can create multiple out files based on the value under Province using a single Output tool. If you select Take File/Table Name From Field as shown below, you will be able to create a unique Output for each unique value for Province. Each output will be filtered to that specific Province.
Let me know if you have any questions or issues with this.
Thanks,
Josh
To write an output for each Province value, a macro is not necessary, nor is a tool for each unique value. What I recommend is using a Formula tool to write the various output file names as a new field and have a single Output tool write all those files. The Output tool configuration gives you the option to "Take File/Table Name from Field" which can be set to a field with multiple values.
Check out the attached workflow that writes a uniquely named .yxdb file for each value in the [Province] field and let me know if you have any questions.
Thanks everyone! Works great for me. @JoshuaGostick @KP_DML @CharlieS
Hello all, I have a duplicated macro inserted after each duplicated multiple filter but i created dynamic file path to separate and save the records as you all suggested but now how do I incorporate the batch macro insertion after it?