cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install the extension.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
derchieh
Level III

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");

//// 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

2 ACCEPTED SOLUTIONS

Accepted Solutions
pmroz
Super User

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").

View solution in original post

txnelson
Super User

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");
Jim

View solution in original post

3 REPLIES 3
pmroz
Super User

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").

txnelson
Super User

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");
Jim
derchieh
Level III

Re: referencing column using Column("name")

Thanks heaps for checking....!

Recommended Articles