Alteryx designer Discussions

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

Dynamic Output Filename

Highlighted
8 - Asteroid

I have a list of input files throughout many years: 2015-2020

2015_input

2016_input

etc

 

How can I dynamically rename output file:

 

eg:

2015_report

2016_report

etc

Many thanks!!!!

Highlighted
8 - Asteroid

Oh. Hi Hung Doan

To rename, you can use Run Command tool.

Config Directory tool to folder containing input and run. You can change pattern name at Fomular tool. Good luck!

Capture.PNG

Highlighted
Alteryx Certified Partner

Hi @hungdm,

 

If you bring full file path in using the drop down option (highlighted) in the input tool we can edit the filename to change the _input to _output and use the amended filename in the output tool.

 

Input files and retrieve full file path:

image.png

 

Next we can use the formula tool to change the filename to 2015_report rather than 2015_input:

image.png

 

 

Finally output using the checkbox at the bottom of the configuration pane of the output tool "take file / table name from field" and "change entire file path" and choose the "FileName" column as the output location. No need to have the "keep field in output" checkbox ticked.

 

You will need to put a dummy output location in the top of the configuration pane (circled red) which will be overwritten by the bottom section take file / table name from field.

 

image.png

 

This will output two new files. One with the data from "2015_input" now called "2015_report" and another with the data from "2016_input" now called "2016_report".

 

image.png

 

If this solves your issue please mark the answer as correct, if not let me know! I've attached a zipped file containing the workflow and the input files.

 

Regards,

Jonathan

Labels