cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

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

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

 例如: 以下脚本是选取年龄是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 IX

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

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 IX

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

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

Recommended Articles