Hello Community
I have written a script in which I search an open data table for rows which contain text A in column 2 AND text B in column 3. Using the row numbers, I then save the text from column 7 for all of those rows to a new individual variable. The problem is I would like to then save the text in column 7 for all those rows in a NewTable with a New Column. The first column was not a problem as I just list the pairs of texts.
However, I am having a lot of trouble making a New Column containing the text for column 7 of the identified rows. Its something like this.
Col 2 Col3 ..... Col7
Hair Red Pass
Hair Blue Pass
Clown Sad Pass
Clown Joke Fail
A= dt << get rows where(contains(as column(2),"Hair")
& (contains(as column(3),"Red");
B= dt << get rows where(contains(as column(2),"Clown")
& (contains(as column(3),"Joke");
HairPassFail = (column(7)[A]);
ClownPassFail = (column(7)[B]);
New Table( "Table",Add Rows( 2 ),
New Column( "TextPairs",Character,"Nominal",
Set Values({"Hair-Red","Clown-Joke"})),
New Column( "PASS/FAIL",continuous,"Nominal", formula(HairPassFail),formula(ClownPassFail))
);
When I show Hair and ClownPassFail, they output the text Pass and Fail respectively. My problem is that as I add new formulas into the New Column for each corresponding rows from the first new colum, the entire column gets overwritten. This is in 10 conditions now 2 for simplicity. So in this example, the output would be
Col1 Col2
Hair-Red Fail
Clown-Joke Fail
Instead of Hair-Red Pass.
Does anyone have any advice as to how I can create a new column where each successive value is a unique formula variable from the series of rows ?
There must be a much easier way to do this I'm sure.
Thanks !!!!