cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
lala
Level VIII

在脚本中如何用列号来代替列名称?

 例如: 以下脚本是选取年龄是13岁的姓名、身高、体重列数据

 

在脚本中如何表示 用第4列、第5列来分别代替"身高"、"体重"列?

感谢帮助!

2021-09-13_220141.png

2 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson
Super User

回复: 在脚本中如何用列号来代替列名称?

You can use the Column() function

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Select Where( age == 13 );
dt << Select Columns( "name", "height", "weight" );
d3 = dt << Subset( Output Table( "A" ), Selected Rows( 1 ), columns( column(4), column(5) ));
Jim

View solution in original post

lwx228
Level VIII

回复: 在脚本中如何用列号来代替列名称?

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Select Where( age == 13 );
c1 = Column( 1 ) << Get Name;
c2 = Column( 4 ) << Get Name;
c3 = Column( 5 ) << Get Name;
dt << Select Columns( c1, c2, c3 );
d3 = dt << Subset( Output Table( "A" ), Selected Rows( 1 ), columns( Column( 1 ), Column( 4 ), Column( 5 ) ) );

View solution in original post

4 REPLIES 4
lala
Level VIII

回复: 在脚本中如何用列号来代替列名称?

jsl

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Select Where( age == 13 );
dt << Select Columns( "name", "height", "weight" );
d3 = dt << Subset( Output Table( "A" ), Selected Rows( 1 ), columns( name, height, weight ) );
txnelson
Super User

回复: 在脚本中如何用列号来代替列名称?

You can use the Column() function

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Select Where( age == 13 );
dt << Select Columns( "name", "height", "weight" );
d3 = dt << Subset( Output Table( "A" ), Selected Rows( 1 ), columns( column(4), column(5) ));
Jim
lala
Level VIII

回复: 在脚本中如何用列号来代替列名称?

dt << Select Columns( "name", "height", "weight" );

Could the  "height and weight" in this line of code also be replaced with column numbers?

 

Thanks Experts!

lwx228
Level VIII

回复: 在脚本中如何用列号来代替列名称?

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Select Where( age == 13 );
c1 = Column( 1 ) << Get Name;
c2 = Column( 4 ) << Get Name;
c3 = Column( 5 ) << Get Name;
dt << Select Columns( c1, c2, c3 );
d3 = dt << Subset( Output Table( "A" ), Selected Rows( 1 ), columns( Column( 1 ), Column( 4 ), Column( 5 ) ) );