We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Adding a new excel sheet, as the first sheet, to an existing excel file

DJC73
5 - Atom

Hello Everyone,

 

I have a simple workflow which produces a new excel sheet. I want to save this new sheet as the first sheet in an existing excel file as each sheet is a daily check which is listed in order of newest check first. At the moment, the new sheet is always written as the last sheet in the existing file. My workflow uses the <List of Sheet Names> option so that I can then use the Select Records tool to select sheet 1 each time it is run.

 

I understand the options available to set the order when creating multiple new sheets in a workflow but I am just looking to set where a single new sheet is located within an existing excel file.

 

Hopefully I am just missing the obvious but any suggestions would be gratefully received.

 

3 REPLIES 3
abacon
12 - Quasar

Alteryx creates the file names in alphabetical or numerical order. If I were to do this, I would use a batch macro to ensure the order in which the file outputs the sheetnames. Try this workflow, I sort the order I want the sheetnames in before it goes to the macro and is grouped on the sorting column, this ensure it will write the data in the desired order.

DJC73
5 - Atom

Thanks abacon. I'm not sure if this applies to what I am trying to do. I understand that Alteryx outputs newly created sheets in alphabetic or numeric order. I am only outputting one sheet. This sheet is being saved to an existing excel file, with multiple existing work sheets, but the new sheet is created as the last sheet when I need to have it as the first sheet.

 

I did try opening your example but unfortunately I am getting an error due to your version of Alteryx being newer than the one I have access to. I am on Version: 2024.1.1.209 Patch: 7

abacon
12 - Quasar

Ok, that makes sense. I think the only way to do this is to pull out the sheet names of the file you are wanting, grab the data from each sheet and re-output the data after sorting the sheet names the way you want them. I re-attached the workflow and macro after pushing the version back to 2024.1 so you can see it in case it can be of use to you.

Labels
Top Solution Authors