Announcement | We'll be doing maintenance between 2-3 hours, which may impact your experience. Thanks for your patience as we work on improving the community!

Alteryx Designer Discussions

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

Adding the month dynamically to the file output while preserving the formatting

JustinB12
5 - Atom

Hello,

 

I am trying to dynamically rename one file while multiple sheets while preserving the formatting of the workbook. I tried changing the entire file path in the output tool using a column created to dynamically change the file name, but receive an error stating I need to specify a sheet name. Attached is my workflow.

 

JustinB12_0-1655404429428.png

 

6 REPLIES 6
DataNath
14 - Magnetar

Hey @JustinB12, as you're replacing the whole filepath from the custom path you're making in the formula, you'll need to define the sheet and range there so it's still present when you replace the output path:

 

Missing sheet name and range xlsx.png

 

You also hadn't configured the bottom output tool like your first so just ensure you do so as below:

 

DataNath_0-1655405083162.png

 

JustinB12
5 - Atom

Thank you for the response.

 

With that change, I am now able to have the sheets identified and the file changes. One issue I am running into now is that when the filename changes to lets say '06 2022', the formatting that was previously in '05 2022' is now lost.

 

Is there a way to still preserve the formatting even with the name change in the file?

DataNath
14 - Magnetar

Do you definitely still have preserve formatting ticked for both output tools?

JustinB12
5 - Atom

Yes, Please see my updated workflow. It will keep the same formatting if I rerun with the same file name, but I did a test run where the file name changed to the next month and the formatting was lost.

DataNath
14 - Magnetar

@JustinB12 I think what is likely happening is that, because you’re changing the filepath before output and obviously the month has changed, you’re not actually overwriting at that point but creating a new file because the name is different. The immediate way of getting around this that I can think of is building the table in Alteryx and then outputting it as a .xlsx from the render tool, though I’m not sure if the formatting you’re applying is beyond their capabilities.

amadra
8 - Asteroid

@JustinB12  - This is possible (maybe not in the most straightforward way).

One way of keeping the same output formatting and renaming the file is by using the blob output tool. Blob output will create a a copy of the original file and will dynamically rename the file.

 

Try the attached workflow by configuring the input (output file of your previous workflow) and a new output file.
In blob input choose the setting "Modify file name by: Appending Field To File Name"

amadra_0-1655426195226.png

I recommend not running this workflow manually and instead chaining this workflow to your original workflow (i.e. run this automatically after the first one finishes), to create your final output file.

Labels