Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Dynamic Select to find Neighboring Fields

emeb1
7 - 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

 

7 REPLIES 7
Thableaus
17 - Castor
17 - Castor

Hi @emeb1 

 

I think you forgot to attach the table.

 

Cheers,

emeb1
7 - Meteor

@Thableaus - thank you!

emeb1
7 - Meteor

Thank you!

danilang
19 - Altair
19 - Altair

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

emeb1
7 - 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

danilang
19 - Altair
19 - Altair

Hi @emeb1 

 

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

 

Dan

emeb1
7 - 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