取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
选择语言 隐藏翻译栏
robot
Level VI

Use Variable Columns in Platform Script

I encounter an error when trying to use variable columns in the Split platform.  Does anyone know why this is not working, and how to resolve it?  JMP 18.2.0.

 

Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA/Big Class.jmp" ); 

// These all work.
dt << Split( Split By( :sex ), Split( :height, :weight ), Group( :name, :age ), Output Table( "Split of Big Class 1" ) );
dt << Split( Split By( :sex ), Split( {:height, :weight} ), Group( {:name, :age} ), Output Table( "Split of Big Class 2" ) );
dt << Split(
	Split By( Column( dt, "sex" ) ),
	Split( Column( dt, "height" ), Column( dt, "weight" ) ),
	Group( Column( dt, "name" ), Column( dt, "age" ) ),
	Output Table( "Split of Big Class 3" )
);
dt << Split(
	Split By( Column( dt, "sex" ) ),
	Split( {Column( dt, "height" ), Column( dt, "weight" )} ),
	Group( {Column( dt, "name" ), Column( dt, "age" )} ),
	Output Table( "Split of Big Class 4" )
);

// This does not work.
split_by_col = Column( dt, "sex" );
split_cols = {Column( dt, "height" ), Column( dt, "weight" )};
group_cols = {Column( dt, "name" ), Column( dt, "age" )};

dt << Split( Split By( split_by_col ), Split( split_cols ), Group( group_cols ), Output Table( "Split of Big Class 5" ) );
1 个已接受解答

已接受的解答
txnelson
Super User

Re: Use Variable Columns in Platform Script

The list needs to be evaluated.

dt << Split( Split By( split_by_col ), Split( eval(split_cols) ), Group( eval(group_cols) ), Output Table( "Split of Big Class 5" ) );
Jim

在原帖中查看解决方案

1 条回复1
txnelson
Super User

Re: Use Variable Columns in Platform Script

The list needs to be evaluated.

dt << Split( Split By( split_by_col ), Split( eval(split_cols) ), Group( eval(group_cols) ), Output Table( "Split of Big Class 5" ) );
Jim

推荐文章