Alteryx Designer Desktop Discussions

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

How to call out a column without specifying the Name of the column?

blitz45
8 - Asteroid

If a field name for a specific column keeps changing (ie. Number, PhoneNumber), how do I not call out the specific name but the column itself when using a formula tool? Is that possible?

4 REPLIES 4
BrandonB
Alteryx
Alteryx

You can also use a Multi Field Formula that uses a conditional and checks to see if a column contains a string within it that would designate it to be used in a calculation. I believe the response above is most likely your solution though if your fields are always coming in with the same column index. 

danilang
19 - Altair
19 - Altair

Hi @blitz45 

 

You can use a technique like this

w.png

 

The first two tools just generate random data with different field types.  The bottom branch uses a Field Info tool to get the field names and a RecordID tool to generate the column indexes.  The first Dynamic Rename renames all the fields to their respective index number.  The Formula tool then calculates based on the column indexes, which are now also the columns names.  The Select tool changes the column order to demonstrate that the rename will work even if the columns are shuffled,  The final Dynamic Rename changes the column names back to the originals. 

 

You can put any combination of tools between the two Rename tools. The second dynamic rename uses the "index" to find the corresponding original names and ignores any new columns or changes in column order.  

 

Dan

blitz45
8 - Asteroid

Perfect explanation! thank you! 

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