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.
F65 | F66 |
40 | 5.23 |
40 | 17159.74 |
40 | 26039.42 |
40 | 0 |
40 | 0.1 |
Solved! Go to Solution.
@Thableaus - thank you!
Thank you!
Hi @emeb1
This was a fun one. It's rare that I get to build a workflow that deals almost exclusively with metadata.
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
The columns of interest table contains 30, 40 and 50. The results are
Dan
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
Hi @emeb1
Sorry about that. I attached the wrong version of the workflow. The correct one is attached
Dan
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 🙂