community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx Designer Knowledge Base

Definitive answers from Designer experts.
Community v19.9

The latest release includes several enhancements designed to improve your Community experience!

Learn More

Output to separate Excel files

Alteryx_KB
Import
Created on

If you have a file that you want to output to separate Excel files you can first create the desired file path with the Formula tool and then utilize the Output tool to change the entire path.

1247 1.png

This example illustrates a file with records from different states, where we wish to create a separate file for the records belonging to each state.




1247 2.png

With the Formula tool, create a string field that will contain the file path, where the path includes the field you’ll use as a part of the file name.  Here we are using the State_Name field. “C: emp” is the path where your files will be saved to.


1247 3.png

"C: emp"+[State_Name]+".xls|sheet1"

The field you are creating, and the field you are including as the variable path name (State_Name) have to be of a string type.  If your variable path name field is not a string type then you can convert it with the TOSTRING function.

1247 4.png

In the Output tool, select Change Entire File Path and select the newly created field. Uncheck Keep Field in Output so it won’t add as a field the path that was created with the Formula tool.

1247 5.png


The Output tool will write separate Excel files, the name and path of the files are the ones created by the formula.

Attachments
Comments
Meteoroid

Thanks, exactly what I needed.

Atom

Alteryx_KB. This is very helpful.

 

Is there a way to output all the separate excel files into a folder where the user can choose the folder before having the files written to? Instead of defining the output file path, I'd like to have the user choose the folder.

Meteor

This is very helpful. I was exactly looking for this. I was trying to build a batch macro for this but now I found that there is a better way to do this. Thanks!

Awesome solution! Thank you very much.

Atom

So helpful & exactly what I was looking for. Thank you!

Meteor

@Alteryx_KB Thanks for sharing the workflow in community and this helps me to blend and separate my data into different files.

 

But I also want to create the different tab within each sheet.

 

For example in the above based on the above by using the formula we have created the file name and in output we have given file as out put so it creates the different files how ever in the Formula if we want different sheet within the each output excel can we give the Name as tab name in each State.

 

Please help me what is the best way get the same.

 

@Alteryx_KB

 

Thanks for the sample workflow. However, when I try to run the workflow based on the above idea i get an error stating 

"Error while appending to existing sheet in Excel. File does not exist:

 

Is there anything else that i am missing.

 

My objective is to create separate excel files the first time i run the workflow and then append the data to the existing excel files when i subsequently run the workflow.

 

Thank you in advance.