cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Use World Cup data to build models, explore spatial relationships, and create informative visualizations in JMP. Register. July 17, 2 pm US Eastern Time.
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

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

Copying Columns Between Data Tables Without Altering the Main Data Table

In the JSL below, this allows for the copying of columns between different data tables. However, I actually don't want to change the current main data table with `Current Data Table()`. Is there a way to modify it so that I can copy columns to another specified data table without altering the current main data table?

 

Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt2 = Open( "$SAMPLE_DATA/Big Class Families.jmp" );

dt << New Formula Column(
	Operation( Category( "Combine" ), "Ratio" ),
	Columns( :height, :weight )
);

script = Column(dt,"height/weight") << get script;

Current data table(dt2);
script;
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Copying Columns Between Data Tables Without Altering the Main Data Table

You can for example use Send()

Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt2 = Open( "$SAMPLE_DATA/Big Class Families.jmp" );

dt << New Formula Column(
	Operation( Category( "Combine" ), "Ratio" ),
	Columns( :height, :weight )
);

script = Column(dt,"height/weight") << get script;

Eval(EvalExpr(Send(dt2, Expr(Name Expr(script)))));
-Jarmo

View solution in original post

1 REPLY 1
jthi
Super User

Re: Copying Columns Between Data Tables Without Altering the Main Data Table

You can for example use Send()

Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt2 = Open( "$SAMPLE_DATA/Big Class Families.jmp" );

dt << New Formula Column(
	Operation( Category( "Combine" ), "Ratio" ),
	Columns( :height, :weight )
);

script = Column(dt,"height/weight") << get script;

Eval(EvalExpr(Send(dt2, Expr(Name Expr(script)))));
-Jarmo

Recommended Articles