Alteryx Designer Desktop Discussions

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

Date and Time stamp to excel output give error incorrect syntax

Mavericks334
6 - Meteoroid

Hi,

 

I'm adding the date and time stamp to an excel output using a formula option and it gives me the below error. If i try to save the file without date and time extension it works fine. This is the formula that i'm using

 

'E:\Alteryx Workflow\Open Notices\Open Notices TEST_'+
DateTimeNow()+
'.xlsx'+
'|||Sheet1'

 

Mavericks334_1-1622065936542.png

Settings of the file.

Mavericks334_0-1622065884397.png

 

Regards,

Renato

 

 

6 REPLIES 6
apathetichell
18 - Pollux

can you post your field Test and the format of the date time stamp?

 

Also - you should have this set to write to a new file since presumably there is no file in existence with the same timestamp -  You have this set to overwrite existing sheet.

Mavericks334
6 - Meteoroid

Field is being created by this formula 

 

E:\Alteryx Workflow\Open Notices\Open Notices TEST_'+
DateTimeNow()+
'.xlsx'+
'|||Sheet1'

 

Date and time stamp by function DateTimeNow() which is 2021- 05-26 17:30:33

apathetichell
18 - Pollux

also - replace the ":"s in the datetime with "." or "_" or something else which isn't a key identifier in file systems.

 

I used:

replace("this is a test"+ tostring(datetimenow())+".xlsx|||'sheet1'",":",".") and it should work for your case after you change to create new...

 

left out the .xlsx above so I updated it.

Qiu
21 - Polaris
21 - Polaris

@Mavericks334 
As @apathetichell pointed out, the ":" is an illegal character for File path or name in windows.
so we have to replace it with someone else.

05270Mavericks334.PNG05270Mavericks334-1.PNG

Mavericks334
6 - Meteoroid

Thank you it worked like a charm

Qiu
21 - Polaris
21 - Polaris

@Mavericks334 

Glad to help and thank you for the accept mark, 😁

Labels