Good Morning,
I have a very simple example which I cannot figure out.
I'm using an UI to select some column. I reference the selected column at some later point in the script. In all case the syntax I use to extract the column name from the list created works except in one (baffling) case when used in conjunction with 'select where'.
I can't figure out why the column designation syntax fails when it used in conjunction with select where. In the unlikely event where 'select where' is incompatible with the syntax column (d[1]) (for d={"test_article}). A suggestion for an alternative syntax would be appreciate.
Best,
Sebastien
New Table( "Select where - test",
Add Rows( 4 ),
New Column( "test_article",
Character,
"Nominal",
Set Values( {"PBS", "PBS", "123", "123"} )
),
New Column( "specimen",
Character,
"Nominal",
Set Values( {"brain", "cord", "brain", "cord"} )
),
Set Row States( [1, 1, 0, 0] )
);
dy= data table("Select where - test");
d={"test_article"};
u={"specimen"};
vari="PBS";
show(d[1]);
show(u[1]);
show(vari);
//dy<<select where(:test_article==vari); //this option spells out the column and works
//dy<<select where(column("test_article")==vari);// this does not work
dy<<select where(column(d[1])==vari); //Fails to select row - issue appear to be with but column(d[1)) not being recognized as column in conjunction with 'select where'
dy<<subset(
Output Table( "10-Reference" ),
Selected Rows( 1 ),
columns(
column (d[1]),// both variables extracted from the list are correctly identified as columns
column (u[1])
));