We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Adding FileName & Time Stamp to Column Header

macst245
8 - Asteroid

Hello, I'm working on a worfklow and this will be my last step before getting it complete.  This is for a workflow that is inside a batch macro which is making this tougher than I thought.  I need to create a column header that includes the input sheet name and the DateTimeNow() function combined.  I also need that column to be completely blank without any data except for the header itself.  I have the dynamic rename tool using the Rename using first row of data and then tried to delete the data using the select tool, but that is not working because the Column header is dynamic and changes whenever the file is started.  I have attached a picture showing the format of what I would need done, and if I can explain anything else please let me know.

 

Thanks

 

macst245_0-1649449875319.png

 

 

 

4 REPLIES 4
JagdeeshN
12 - Quasar
12 - Quasar

@macst245  can you please explain further on why and how you are using the batch macro within your workflow?

macst245
8 - Asteroid

@JagdeeshN Yes, I have about 20 input files that I need run through the workflow one at a time so all the input sheets get the same processing.  I created a macro from this workflow and am running the macro in a separate workflow as shown below to finalize formatting and the output of the files.  I'm thinking the work I need for the column header done should be done inside the macro.  

 

macst245_0-1649451038068.png

 

danilang
19 - Altair
19 - Altair

Hi @macst245 

 

You can use this technique to append a timestamp column with blank values

 

danilang_0-1649505427769.png

The timestamp column input has one column with one dummy row.  After resizing it, build the column name including the timestamp.  Rename the column taking the name from the first row of data.  This results in a column with no values.  Append this column to your data.

danilang_1-1649505589391.png

You should be able to insert this technique in the macro.   If you want the files produced in the macro to have the same timestamp, use DateTimeStart() which returns the time the workflow started instead of DateTimeNow() .

 

Dan

 

 

macst245
8 - Asteroid

@danilang Thanks for the response, however this will not work because I need the column header to be dynamic to match the input file name.  This is appending "Sheet ABC" to every excel sheet, when I need that name to be dynamic to match the input file names.

Labels
Top Solution Authors