Alteryx Designer Desktop Discussions

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

Output Current Date to File Name with Multiple Sheets

ankush-agrawal
7 - Meteor

Hello Reader,

 

There is a requirement to add current date to the file name of the output. Attached is the snapshot showing alteryx feeding to multiple sheets in same excel file.

FileName: INVID vs PSGL Check.xlsx

 

How do I achieve to rename the file name each day with current date without causing issue in the flow?

I have seen multiple cases in community already but could not find the case where user has multiple sheets in same excel file.

 

Thanks for your help in advance.

7 REPLIES 7
AmalinaH
Alteryx
Alteryx

Hi @ankush-agrawal , would something like this work for you?

 

This involves having a text input file where you would need to specify the folder path and file name you'd like to save to.

We can then use the datetimetoday() formula to include today's date dynamically in the full path.

AmalinaH_0-1655956238885.png

 

Then for your output tool, in the bottom configuration you would need to take name from the field we created for the full path and select "Change Entire File Path".

 

AmalinaH_1-1655956429745.png

 

Let me know if this is closer to what you're looking for!

ankush-agrawal
7 - Meteor

Do you mean I apply this solution after generating the output? Taking the output file generated as input again?

AmalinaH
Alteryx
Alteryx

You would apply this solution instead of the current "Output Data" tool in your workflow.

 

I have group it as a macro so you can just insert this instead of the output data tool.

 

Let me know how you get on!

ankush-agrawal
7 - Meteor

For each sheets in the excel or just one Sheet?

AmalinaH
Alteryx
Alteryx

Hey @ankush-agrawal it would depend on how your file outputs and data sets are currently being configured at the moment. I mistakenly assumed you were using just 1 tool for output to various sheets but looks like you have multiple and each save to a different sheet?

 

Could you perhaps share what the dataset looks like as well as some detail around how you are grouping it into sheets? 

ankush-agrawal
7 - Meteor

Attached snapshot is how my file looks like, can you have a look? I have set multiple checks whcih is feeding to different tabs of same excel file.

My only concern is if I apply above solution to one of the output, how will it impact others?

AmalinaH
Alteryx
Alteryx

Hi @ankush-agrawal , 

 

Hopefully if I understood your requirement properly - could you test out whether this updated macro works?

 

You would need to replace your output file tools in your workflow with the macro instead.

 

AmalinaH_0-1655971717441.png

 

For each macro you insert, you will need to configure the following to specify the folder to save to, the file name, and the sheet name.

 

AmalinaH_1-1655971801668.png

 

It should save your file with the name 2022-06-23_INDIV vs PSGL.xlsx (for today's date).

 

If you apply the solution to one output it will only impact the sheet that you are specifying for that particular output.

 

Hope this helps further, let me know if I can guide with anything else.

 

Labels