Hi Ian Ian@JMP,
An extension to what I was previously working on:
Using the same data as the previous question, based on the selected words that I want from the available columns in data table "Air Traffic", I am expecting an output as shown below if the available columns in the data contains the words in the "SelectedNames" column at their respective rows:
![11978_pastedImage_2.png 11978_pastedImage_2.png](https://community.jmp.com/t5/image/serverpage/image-id/3370iA11D389DB30B9669/image-size/medium?v=v2&px=400)
However I am getting this error message in Log & no insertion of any correct column names in the second column:
![11979_pastedImage_3.png 11979_pastedImage_3.png](https://community.jmp.com/t5/image/serverpage/image-id/3371iC8F9356E16FBE190/image-size/medium?v=v2&px=400)
![11980_pastedImage_4.png 11980_pastedImage_4.png](https://community.jmp.com/t5/image/serverpage/image-id/3372i6824ECC3296422FF/image-size/medium?v=v2&px=400)
These are my codes, can you help me to check what's wrong with them?
dt = Open( "$SAMPLE_DATA/Air Traffic.jmp" );
a = {"Number", "Flight"};
col = dt << get column names( string );
nc = N Items( col );
dt1 = New Table( "Table1" );
c1 = (dt1 << New Column( "SelectedNames", character, set values( a ) )) << get values;
dt1 << New Column( "AvailableColumns", character );
xxx={};
For( j = 1, j <= N Items( c1 ), j++,
For( i = 1, i <= nc, i++,
If( Contains( col[i], a[j] ),
Insert Into( xxx, col[i] )
);
Column( dt1, 2 )[j] = Eval( xxx );
xxx = {};
);