Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Exporting to multiple files using existing template

Aanalyst
5 - Atom

Hi Everyone,

 

I'm trying to set up a workflow to export data to multiple files using named ranges and using an existing template. Please note that I am unable to use the run command function as I am building this on a company server and is therefore restricted.

 

For Example:

This is my dataset:

Aanalyst_0-1636026289477.png

 

I want to export this to multiple files based on the unique code but using an existing template. The result I want is:

-Individual file for each unique code

Aanalyst_1-1636026421987.png

 

- Within each file, data has been exported into named range (Shown in yellow) using an existing template

Aanalyst_2-1636026473573.png

 

I hope that makes sense and thank you in advance.

 

 

 

1 REPLY 1
EKBS83
7 - Meteor

Hi,

 

This was a tough one as the formatting requirements for your template are very specific, with gaps between your columns etc which makes things quite messy.

 

I created a record ID for each row, and transposed your data based on this number.

I joined your Code and Name columns back into the data based on the Record ID number so could then use this later to create a field containing the filename details to create each separate excel output.

 

Unfortunately as the template is split with some records in columns B:C and some E:F, I had to create 2 streams, one for each set of columns.

2 formula tools are used to then create a new Filename column, which specifies exactly the range needed when you output the data.  

You will need to replace the text in the formula with your own folder path (cannot share mine for confidentiality reasons).

Drop the columns that are not needed with select tools and then have 2 outputs, one for each range on the excel file.

 

You will need to create a dummy output file for Alteryx to read, or it will not work.

 

The output tools are configured as "Change Entire File Path" and this is linked to the Filename column created earlier on..

Even though it is configured as "overwrite sheet  or range", as you are changing the file name completely, it creates new excel files based on the unique key created and puts them in the folder specified in the formula tool.

Skip field names ensures that the column headers do not feed through.

One output tool writes the first 4 filtered rows to columns B:C and the other writes the last 2 filtered rows to columns E:F

 

Hope this helps

Thanks

Ed

 

EKBS83_0-1636475656751.png

 

 

 

 

 

Attached workflow

 

Labels