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.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.
  • JMP will suspend normal business operations for our Rest and Recharge Day on Friday, October 2, 2026.
    Regular business hours will resume on Monday, October 5, 2026.

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