Alteryx Designer Desktop Discussions

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

Rename column to the name of the existing file.

natalieotto
5 - Atom

I am trying to rename a column in my file and change it to the current file name. Is there a way to do this? I want it to be able to change with each different file I choose. I'm not sure if the Dynamic Rename tool is the correct tool, and if it is, what expression should I use?

3 REPLIES 3
DataNath
17 - Castor

Hey @natalieotto, you can definitely do this. We just need to:

1) Bring in the FileName with the data (Input Data tool configuration)

2) Set up a look-up with the current field name next to the FileName field

3) Use a Dynamic Rename tool, taking field names from the right input's rows

 

Have attached an example here. Hope this helps!

natalieotto
5 - Atom

Thank you, this helped a lot! One last question, in the Formula Tool I entered FileGetFileName and it's asking for a path. What would I put there?

DataNath
17 - Castor

Good to hear @natalieotto! In there you'd place a full file path i.e. C:\User\MyDocuments.... etc and it extracts the FileName at the very end.

One of the Input Data tool options is to bring in the full path so that's a case where you could do that and use this function, or you may just have file paths as part of your data!

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels