Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
There's still time to register for the Q3 ACE Panel - Spatial Edition presentation tomorrow! | Need more information about the event? Check out the post here

Adding date to my output date in excel

Highlighted
8 - Asteroid

Hi There,

 

I am trying to add today's date to my output data in excel file. I see responses on here to tick the "Take File/Table Name from a field" then Append Suffix to File/Table Name and Today_date. I have done this also adding in the formula tool to add DateTimeNow() in my worksheet.

 

The above works for me on a CSV file, however, it doesn't when trying to change to xlsx

 

I have also tried to use the Render tool and this saves the file down with the date correctly but changes the format and removes half the data.

 

Any ideas how to resolve this?

 

Thanks

 

Highlighted
12 - Quasar

What you tried first should have worked. Can you share the workflow so we can see what's up?

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner
The appened prefix/suffix does not work with XLSX files as it is changes the sheet name rather than the output name.

In order for this to work with an xlsx file you can use a formula tool to create your entire file path, then use the ‘change entire file path’ option instead.

Something like:

“C:\desktop\myfile_”+tostring(datetimenow()+”.xlsx|sheet1”

Hope this helps.

Ben
Highlighted
5 - Atom

***Edit: BenMoss beat me to the punch. See his response above***

 

Can you give a little more detail about what you mean by "add today's date to my output data in excel file"? It sounds like you are trying to add the date to the end your output file name (as opposed to the sheet name). I think part of the reason Excel files can be tricky is that they have worksheet names that can get in the way of renaming, which is why you may have had success with .csv or other file types.

 

One relatively easy workaround could be creating a "File Name" field and then changing the drop drop down under "Take File/Table Name from Field" to "Change Entire File Path" with "File Name" selected. I used a formula tool to create the "File Name" field with a formula "C:\**your file path**\**your file name**" + [Date] + ".xlsx|||**your sheet name**". You could also add the datetimenow function into this formula but you'll probably need to include a datetimeformat function as well unless you want the time included as well as the date in your file name. I chose to have another formula with the datetimenow call.

 

Hopefully this helps, but let me know if you were asking a different question.

 

image.png

Highlighted
8 - Asteroid

Thanks, unfortunately can't paste anything from here as all blocked. But have a response below. Thanks

Highlighted
8 - Asteroid

Hello -

If i have to attach the latest file based on the date stamp how will the Email tool be configured for the same? 

For example- i have a data extract file which needs to be sent out everyday with the date stamp in the file header , i was able to achieve the same using the answer above however if i have to send this file daily as an attachment then how will the email tool be configured?

Thank you.

Labels