referencing column using Column("name")Hi,
I have a "quick" question:
dt = Open( "$Sample_data/Big Class.jmp" );
//// These don't work;
dt << Select where( Column("sex") == "F");
dt << Select where( Column(3) == "F");
<BR />//// Only this works...why??
dt << Select where (:sex == "F");I am pretty sure all these options used to work for me.....has something changed? I am using JMP16.
Reason I am asking is because I usually have the column names in a list, then create iteration using For loop and Column(colname[i]) to point to the appropriate column.
Any help will be much appreciated. Thank you.
Derchieh
ScriptingRe: referencing column using Column("name")Thanks heaps for checking....!
Re: referencing column using Column("name")You need to use the As Column() function. I tested the code back to JMP 11 and the Column() function did not work, only the As Column()
names default to here(1);
dt = Open( "$Sample_data/Big Class.jmp" );
//// These don't work;
dt << Select where( as Column("sex") == "F");
dt << Select where( as Column(3) == "F");
//// Only this works...why??
dt << Select where (:sex == "F");Re: referencing column using Column("name")This works:
dt = Open( "$Sample_data/Big Class.jmp" );
//// These work now;
dt << Select where( as Column("sex") == "F");
dt << Select where( as Column(3) == "F");
//// Only this works...why??
dt << Select where (:sex == "F");
In general, if column("col-name") doesn't work, try as column("col-name").