Alteryx Designer Desktop Discussions

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

Automate Column name with File name

areeba
8 - Asteroid

Hi @atcodedog05 

 

I have a requirement where my column name has to be update with file name .

 

for example :

 

I have 2 files with the name:

1) 2021Finalreport07

2)Monthly 12-2020

 

From each file I need to create a column , where column name picks up the year from the file name.

 

column name should be like of file1: Budget Year 2021

column name should be like of file2: Budget Year 2020

 

Idea is to automate the column names every year as per the filename year.

 

Can you give suggestions?

 

Regards

Areeba

 

 

26 REPLIES 26
areeba
8 - Asteroid

Hi @Peachyco 

 

Thank you , this is exactly what i was looking for 😀

 

@Peachyco @atcodedog05 : is it possible to do the same this with formula option of Dynamic Rename tool?

 

Regards

Areeba

atcodedog05
22 - Nova
22 - Nova

Hi @areeba 

 


@areeba wrote:

is it possible to do the same this with formula option of Dynamic Rename tool?

 


The answer is No. We need to use a method similar to @Peachyco approach reason being if we use formula mode there is no way to reference filename column value and get year from it. Refer the below.

atcodedog05_0-1634632659416.png

 

As you can see above we cannot reference any column value in the dynamic rename formula mode. Hence we cannot create a column name with year in the name.

 

Hope this helps : ) 

 

 

areeba
8 - Asteroid

Hi @atcodedog05 

 

Yes , I agree . This is where i was also getting stuck.

 

Thank you for the explanation.

 

Regards

Areeba

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @areeba 

Cheers and have a nice day!

areeba
8 - Asteroid

Hi @atcodedog05 , @Peachyco 

 

In the continuation of this workflow , i have a scenario where i have to do final total at last stage. Dymanic rename is working fine until in my input file the year doesn't get change.

Fore ex: if the year in my filename updates from 2021 to 2022 , it throws error at the last stage in sumarize tool.

 

what step should i take to keep everything dynamic?

 

Please find attached workflow for more understanding.

 

Thanks

Areeba

atcodedog05
22 - Nova
22 - Nova

Hi @areeba 

 

Move the renaming to the end.

 

Workflow:

atcodedog05_1-1634721896480.png

 

Hope this helps : )

 

areeba
8 - Asteroid

Hi @atcodedog05 

 

Thank you for the solution but thing is in my real workflow i have 9 other columns apart from Budget.

 

Is there a way i can do this in just one step for the last stage, because for 9 other columns i have to do it 9 time again , like i already did.

 

Regards

 

Areeba

atcodedog05
22 - Nova
22 - Nova

Hi @areeba 

 

It should work just use the dynamic rename at the end.

 

Hope this helps : )

areeba
8 - Asteroid

Hi @atcodedog05 ,

 

i have added one column 'Forecast' it is working only for 1 column not for Budget and Forecast.

 

Also how to fix the second part of the join?

 

Please find attached workflow to see the changes i did.

 

Regards

Areeba

 

 

atcodedog05
22 - Nova
22 - Nova

Hi @areeba 

 

Can you provide me expected output from this workflow.

Labels