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.
  • 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
uday_guntupalli
Level VIII

Save Analysis to Table Using Variable (in JSL)

All, 

    Trying to figure out how to save an analyses to a data table using a variable . I tried multiple options : 

1. Option 1 : Adding Col List to table as a variable 

 

 

dt = Open("$SAMPLE_DATA/Big Class.jmp");
myvar = dt << Get column Names("String");
dt << Set Table Variable("ColNames", myvar);
dt << New Script("Save Analyses Using Variable",
Bivariate(myvar[2],myvar[4],Fit Line)
);



2. Using the column name from a list 

BivAfter = Bivariate(
                           Y( Eval(TempCols[r])), // 
                           X( :age ),
                          Automatic Recalc( 1 ),
                           Fit Line( {Line Color( {213, 72, 87} )} )
                           );



Option 2 works when you are running the script and saves the analyses to the data table . But if I close the script and try to launch the analyses from the table - it fails . 
Can anybody help please ? 
Best 
Uday 


 

Best
Uday
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Save Analysis to Table Using Variable (in JSL)

You need to evaluate your column references before adding a new table script. See example below.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
myvar = dt << Get column Names();

Eval(
	Eval Expr(
		dt << New Script(
			"Save Analyses Using Variable",
			Names Default To Here( 1 );
			dt = current data table();
			biv = dt << Bivariate( Y( Expr( myvar[2] ) ), X( Expr( myvar[4] ) ), Fit Line );
		)
	)
);
Justin

View solution in original post

1 REPLY 1

Re: Save Analysis to Table Using Variable (in JSL)

You need to evaluate your column references before adding a new table script. See example below.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
myvar = dt << Get column Names();

Eval(
	Eval Expr(
		dt << New Script(
			"Save Analyses Using Variable",
			Names Default To Here( 1 );
			dt = current data table();
			biv = dt << Bivariate( Y( Expr( myvar[2] ) ), X( Expr( myvar[4] ) ), Fit Line );
		)
	)
);
Justin

Recommended Articles