Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Datestamp to Ouput File name

ankush_nayyar
5 - Atom
I have few monthly tasks where the data is refereshed. My Input file is from the Oracle dba and the output file is on my local drive. I would like the output file to be overwritten with datestamp as a prefix or suffix to the filename when I run this monthly module. Ideally I would like the datestamp to be MAX([DATE]) but Today's date would also solve my purpose.
 
18 REPLIES 18
jwpetrov
6 - Meteoroid

MarqueeCrew:

 

Thanks for replying... I've tried to implement your suggestion, but it's unclear to me exactly how to make this work. (I'm all for making it simple.)

 

When you "prepend" the date, are you using a formula and including only date-related elements?

 

Also, if I'm understanding correctly, you create a second formula for the full filename, date/time stamp and also include the name of your Excel sheet. If so, I'm not seeing a way to use this in lieu of the output file name. Just to be clear, are you using the Output Data component or perhaps the Table/Render components?

MarqueeCrew
20 - Arcturus
20 - Arcturus

Screen Shot 2016-06-28 at 1.16.10 PM.png

 

I've configured the output file to create:  20160628_outputfile.xlsx|Sheet 1

 

At the bottom of the configuration, I read a field [Output Name] and there I've calculated the whole path of the file.  This will replace whatever is in the "write to file or database" configuration.  Because I have run this multiple times, I have the #3 option set to "Overwrite File (Remove).

 

The output doesn't include the contents of the field, Output Name, because I UNCHECKED the "Keep Field in Output" configuration option.

 

Now let's see the formula for the [Output Name] field:

 

Screen Shot 2016-06-28 at 1.20.35 PM.png

 

I created a field called [Output Name] and constructed it to use the current date in the file name.  You could place it before the "name" or after it.  I'll show you code for creating:  "C:\Desktop\TestData_2016-06-28.xlsx" (Daily Data)

 

"C:\Desktop\TestData_" +
DateTimeFormat(DateTimeNow(),"%Y-%m-%d") +
".xlsx|MyData"

I get the desired current date wherever I want in the output file name.  Complete control for the cost of a formula.

 

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
mtakka1
7 - Meteor

Is there a way to make it work even if there is no output (0 rows).

prajgiri
5 - Atom

Hi All,

 

Is there a way we can the do the same with render tool? 

 

The workflow runs everyday and saves the file into an archive. T differentiate, i need the file name prefixed with current date.

 

 

DennyChan
8 - Asteroid

hello

 

I have a more advance question, in relation to my question back in 2015

 

can you date stamp a file and , separate the data into tabs in one output tool

 

I ask this because it use the same output tool to add the date to the filename or to generate data into difference tabs

 

The result i would like it

file name will "export 2019-06-20.xls"

tab in the spreadsheet should be in "NEW" and "OLD"

 

thanks for your time

 

Denny

 

 

 

kpdavern
5 - Atom

this is driving me insane. I keep getting "Must specify sheet name" but my configurations are the same i've tried it 1001237891 different ways (replace sheet, overwrite file, etc and tried adjusting the bottom config too (change entire file path etc) but nothing works. the best i can get is the tab renamed, but i want to rename the file. i can do it using the render tool but i hate the table it produces - anyone had any luck?

 

clipboard_image_0.png

CDunhill
8 - Asteroid

Trouble is, I found when working with a large data set the 'date-time' changes between processing the first row and the end.

 

I ended up with about 6 separate files instead of 1 because of the lag, presumably taking about 6 seconds to process.

 

I solved it using DateTimeStart() instead.

Raphael_Kotzock
7 - Meteor

Here is the solution I was able to come up with:

Formula tool 2 calculations:

1. Date = DateTimeToday()

2. File Name = "Enter File Path (incl Excel File name)" + [Date] + ".xlsx///Sheet Name"

 

in Output Data tool Select Change Entire File Path -> Select calculated field [File name]

 

if wanted you can unselect "Keep Field in Output", as well as use a Select tool to unselect [Date} then your data will not include any of the 2 calculated fields.

venkat05
6 - Meteoroid

Hi Body,

 

kindly share this workflow.

 

i am not clear about this, please help me.

 

regards,

venkatmurugan

Labels