Alteryx Designer Desktop Discussions

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

Rename any excel input column name (regardless of its format) to generic name

AkisM
10 - Fireball

Hi all,

 

I'm looking for a way to create a simple workflow that can have any excel input and rename all the columns of that input to something generic (Text1, Text2, Text3 or A, B, C or F1, F2, F3 etc). The number of columns of each excel is unknown.

 

I need this because after this renaming of the columns, I will have a formula that looks for a value in a specific column position (based on position, not name). So if the name of that column doesn't exist in another excel of a different format, the workflow would break. But if I can somehow always rename any and all columns of each excel from the beginning of the workflow, it would work.

 

Can someone attach an example?

2 REPLIES 2
AngelosPachis
16 - Nebula

Hi @AkisM ,

 

Assuming that your input looks something like this:

AngelosPachis_0-1640248187592.png

 

You can rename all columns to F1, F2 and so on by ticking the "First row contains data" box under options on the left hand-side of your screen

AngelosPachis_1-1640248283765.png

 

The final step is to start data input from row 2, and that will remove your headers that will now appear as data in the first row

 

AngelosPachis_2-1640248342340.png

 

Another way to work with your data in case you don't know the number of columns or in case column headers may change slightly is to find a key column (something like a record ID or similar that will always exist across all files) and then transpose all other columns to rows. In that way, you won't have to reference the name of the columns anywhere in your macro.

 

Hope that helps,

Angelos

AkisM
10 - Fireball

Thanks @AngelosPachis , you're right, I completely forgot that by simply checking the "first row contains data" option, alteryx will always give the default placeholder column names to any excel input. That is good enough for what I'm trying to achieve. Thanks.

Labels