Hi guys,
I have a created a template with conditional formatting (color, letter style etc.) and run it using "run command". I was successful in combining my data with the template however I failed in renaming the file. When I rename it using the formula tool, it creates a separate file with no conditional formatting.
Can anyone help me how to rename my file without removing the conditional formatting? The format of the file is [Month Date] + "Filename" + [Datetimetoday]
Below are information of the workflow.
Looking forward for everyone's expertise on this.
Thanks,
Kamen
Solved! Go to Solution.
Hi @DavidSkaife
Come to think of it, I have 3 output files. Each output file has 2 to 3 sheet tabs on it. How can I attached a formula tool at the beginning and what will be my formula syntax?
Please advised.
Kamen
Your macro works! However, it doesn't provide me the correct filename. It does not capture the "filename" of the file.
Can you help me provide the correct syntax in the formula tool? As I said I have 3 excel files.
The filename should be:
Month Date + Filename + Date Today
12-2022 Singapore Report 12-22-2022
12-2022 Taiwan Report 12-22-2022
12-2022 Mexico Report 12-22-2022
Looking forward for your response.
Thanks,
Kamen
Hi @KamenRider
Try this formula for the FileNewName column
Replace([FullPath], [FileName], DateTimeFormat(DateTimeToday(), '%Y-%m') + ' ' + replace([FileName], '.xlsx', ' ') + DateTimeFormat(DateTimeToday(), '%m-%d-%Y') + '.xlsx')
BEFORE RUNNING IT
AFTER RUNNING IT
I have tried the macro to my live workflow and I notice that it gave me six files. The other 3 was its BAK file. Is it possible to remove it or place it in another folder or hide it?
Looking forward for your response.
Kamen
Hi @KamenRider
These .bak files are backup files (https://community.alteryx.com/t5/Alteryx-Designer-Discussions/What-is-bak-file-used-for/td-p/22195). The .bak came to the middle of the name because of the change of filename.
Anyway, two possible ways to deal with it, just place a filter filtering contains([filename], '.bak') before of the macro that you think that is better for your case:
DELETE THE .bak FILES
https://community.alteryx.com/t5/Community-Gallery/Delete-Files/ta-p/1005983
MOVE THE .bak FILES TO A DIFFERENT FOLDER
Thank you @Felipe_Ribeir0 and everybody who help me with this .. @DavidSkaife @grazitti_sapna
Finally the problem is solved. Thank you for your ideas and contributions.
Kamen