community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Dynamic Select to find Neighboring Fields

Meteor

Hello!  Long time reader, first time poster.  

I'm working with a dynamic select tool in an effort to identify columns that may move around from run to run.  In my source data, odd numbered columns contain "Field Names" for the system it interacts with.  The fields to the right of the "Field Name" columns contain the data for that row. I need to figure out how to find the "Field Name" field by name in dynamic select (which I've done) AND THEN select the one to the right of it.  The field numbers may change based on any number of factors, so the ID by name, then position tactic is the most reliable. The attached table contains an example, where 40 is the field name.  That is the only value in that column.  The next column over is the value, which can change.  What is constant is the relationship between the left and right columns. 

F65F66
405.23
4017159.74
4026039.42
400
400.1

 

Alteryx Certified Partner
Alteryx Certified Partner

Hi @emeb1 

 

I think you forgot to attach the table.

 

Cheers,

Meteor

@Thableaus - thank you!

Meteor

Thank you!

Nebula
Nebula

Hi @emeb1 

 

This was a fun one.  It's rare that I get to build a workflow that deals almost exclusively with metadata.

 

 

Workflow.png

The work flow finds all that data columns that match the values in the columns of interest list.  It starts by finding all the columns that have the same values in all the rows.  This is to avoid the case where the data value could actually match the value that marks a column of interest.  I used a sample of the first 10 rows and found the ones with all the same value.  This is joined to the columns of interest to pull out names of these these column.  From there on it's a question of finding the position of these columns using the Field Info, finding the name of the columns to the right of these and renaming those to be able to select them.  

 

Here's the input data that I used 

 

Input.png

The columns of interest table contains 30, 40 and 50.  The results are 

 

results.png 

 

 

Dan

Meteor

Hi @danilang!  This is incredible, thank you!  One question for you - the dynamic select is looking for field names that start with "CI_" but that's not added to the name at any point in the flow.  Where was that intended to happen?

Thanks

Nebula
Nebula

Hi @emeb1 

 

Sorry about that.  I attached the wrong version of the workflow.  The correct one is attached

 

Dan

Meteor

This is amazing. My one tip to any future users is that the "Text Input" auto-fields the "Column of Interest" data and can cut off your fields, so make sure that's the correct length for you  

Labels