We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Name in column changes but always in the same position in Excel file

MikeFrancis1959
8 - Asteroid

I have a excel file that I use all the time but I am not the originator of it. There is a column that always changes the name and but it will always be in column 36. How can I tell Alteryx to use this field regardless of the name. 

Thanks,

Mike

5 REPLIES 5
OllieClarke
15 - Aurora
15 - Aurora

Here's one way of doing this:

OllieClarke_1-1678800907656.png

You read in the excel with 'first row contains data' ticked. This lets you select columns by position

OllieClarke_2-1678800949278.png

You can then rename just the specified column (F3 for me, F36 for you) using a dynamic rename:

OllieClarke_3-1678801009609.png

Once you've done that, we can rename all other columns from the first row with another dynamic rename:

OllieClarke_4-1678801057142.png

Finally we use a select tool to set the data types to what they should be:

OllieClarke_5-1678801083197.png

You can now reference the field by name ([Fixed]) in all subsequent tools

 

This approach means we don't need to pivot our data (which can be slow with larger sets) - you could use an autofield tool instead of the select, but I don't like using one in production workflows. 

 

Hope that helps,

 

Ollie

 

 

 

 

 

 

MikeFrancis1959
8 - Asteroid

Thank you, I will go through this to understand the flow and then proceed to change my workflow!

Mike

danilang
19 - Altair
19 - Altair

Hi @MikeFrancis1959 

 

Here's slightly different way to accomplish this while retaining your original field types and restoring the original variable field name if required

 

danilang_0-1678820144657.png

 

Use a field info tool to get all the field names and add a record id.  In the Formula tool change the variable field to a static name and keep the other names the same.  Use a Dynamic Rename to rename from the old names to new ones.  Apply your formulas.  If required, you can go back to the original fields names by using a second Dynamic Rename to go from new names back to old. 

 

Dan

 

MikeFrancis1959
8 - Asteroid

Thanks, I will try this also!!!

Mike

NabilTan
5 - Atom

I've just used this and it works great, Thank you. I had a similar issue with data being sent with 2 columns which kept changing column name based on the month we were in. This has fixed that. It is now set up so that the changing column names become static running a few dynamic renames!

Labels
Top Solution Authors