Alert: There is a planned Community maintenance outage October 16th from approximately 10 - 11 PM PST. During this time the Alteryx Community will be inaccessible. Thank you for your understanding!

Alteryx Designer Desktop Discussions

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

Output File Name

Lauriek
7 - Meteor

Hello,

 

How do I setup the output file name to automatically change the date portion based on the Input file name.  For example, the input file is named 2021-04-30 GL 331115 State.  I want the output file name to be 2021-04-30 CR TX Gasoline Workpapers.

 

Only the date changes, the rest of the file name is always the same.  I tried looking up other post about this, but they are not quite the same.

 

Thank you,

Laurie

7 REPLIES 7
Luke_C
17 - Castor

Hi @Lauriek 

 

Depending on the type of file you're outputting to this might change slightly, but generally you can use a formula tool to create a file name, and then in the output tool use the settings to take the filename from a field in the data. For this instance you will want to do the following:

 

  1. Make sure the input filename is read into the data (this is a setting on the input tool)
  2. Use a formula tool to either make a new field or modify that field. If the file name is going to consistently start with a date in yyyy-mm-dd format, you can do something simple like Left([File Name],10)+" CR TX Gasoline Workpapers.csv". (example is csv but whatever file extension is needed can be put)
  3. In the output configure the file name settings to update either the full path or file name.
    1. Note: If you're doing excel, you may need to tweak the above to include the full file path/tab name for it to work. CSV would not need this. 

 

 

Luke_C_0-1622649430407.png

 

apathetichell
19 - Altair

Bring the filename into your workflow and edit it via regex_replace as attached.

 

note @Luke_C 's way works too assuming relatively static filenames.

mceleavey
17 - Castor
17 - Castor

Hi @Lauriek ,

 

I'm assuming you're loading in Excel files, so in your input tool, select from the dropdown to bring in the filename as a field:

 

mceleavey_0-1622649367816.png

 

Then, on that field you can use the regex tool to remove the existing date, then a formula tool to add today's date to the start of the filename:

 

mceleavey_1-1622649444983.png

 

mceleavey_2-1622649463871.png

 

 

mceleavey_4-1622649530300.png

 mceleavey_3-1622649491330.png

 

Hope this helps,

 

M.

 

 

 

 

 



Bulien

Lauriek
7 - Meteor

Hello,

 

Both files are excel.

Lauriek
7 - Meteor

Hi Luke_C,

 

Both input and output files are excel.

apathetichell
19 - Altair

same workflow - but edited for .xlsx input.

Lauriek
7 - Meteor

Hi @Luke_C ,

 

For #1, do I change Output File Name as Field to Full Path?

 

Thanks,

Laurie

Labels