Is there a way to select columns based on position? I want to delete all columns to the right of a column labeled "Indicator". That column name is irrelevant, but the idea of removing columns to the right of a specific column is what I'd like to do. I did come up with one way to do it but was curious if there is another way.
My way was to:
1) take the first record, then transpose to get the names of the columns in the "Name" column.
2) I used a record id tool to provide a record for each column.
3) Then I used a formula tool to add record id and "Name" column.
4) Next, I dynamic renamed using "take field name from right input rows". So now the column labeled "Indicator" actually is labled "17_Indicator".
5) Lastly I used a dynamic select with a formula "ToNumber(Left([Name], 2)) <= 17" which dropped the other columns obviously.
I am not sure this sequence is the most efficient way. Is there another way to deselect columns to the right of a specific column? Thanks!
Solved! Go to Solution.
Hi @gwiz
There's an option to select "Field Number", which is the position of your column in your dataset.
Cheers,
^ In the Dynamic Select tool.
To do all the action you described, I would probably go about it in the same way you already have. One suggestion would be use the Field Info tool to get the names rather than sampling a record and transposing.
That certainly helped! Thank you thank you @Thableaus! good thing to know now going forward
Yes thats a good thought too @CharlieS, thanks