cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • 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
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 ACCEPTED SOLUTION

Accepted Solutions
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

View solution in original post

1 REPLY 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

Recommended Articles