Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Renaming the File without Removing the Format created in the Excel

KamenRider
11 - Bolide

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.

 

Two Template.PNG

Output.PNG

FilepPath.PNG

Looking forward for everyone's expertise on this.

 

Thanks,

Kamen

 

15 REPLIES 15
KamenRider
11 - Bolide

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?

 

Workflow Proces.PNG

Please advised.

Kamen

KamenRider
11 - Bolide

Hi @Felipe_Ribeir0 

 

Your macro works! However, it doesn't provide me the correct filename. It does not capture the "filename" of the file.

 

New Name.PNG

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

Felipe_Ribeir0
16 - Nebula

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

Felipe_Ribeir0_0-1671631245235.png

 

 

AFTER RUNNING IT

Felipe_Ribeir0_1-1671631298683.png

 

 

KamenRider
11 - Bolide

Hi @Felipe_Ribeir0 

 

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?

 

Bak file.PNG

Looking forward for your response.

 

Kamen

Felipe_Ribeir0
16 - Nebula

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

https://community.alteryx.com/t5/Community-Gallery/Move-files-between-origin-and-destination-path/ta...

 

 

 

 

KamenRider
11 - Bolide

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

Labels