cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
ClusterFerret68
Level III

Help with script to rename data table

Hello,

I'm trying to streamline some analysis and am dipping my toes into JSL.  In the current case I'm running a 4PL fit of some data then generating a table of the curve parameter summaries.  I'm able to make the new table but it will be named by default "Untitled X" (where x is just an iteration of numbers...).  I can manually rename to "4PL"...which my follow on tasks will point to.

 

What I'd like to do is have the original script make the new table and set the name to "4PL".  I've searched the archives and tried the Set Name function...but I think I'm not getting the syntax correct.  Any help would be appreciated.

 

Here's the script I'm running (without the Set Name function):

 

Names Default To Here( 1 );
rpt = New Window( "RM Tracking- CV - Fit Curve of Avg Response by log(Conc)",
Data Table( "RM Tracking- CV" ) << Fit Curve(
Y( :Avg Response ),
X( :"log(Conc)"n ),
Group( :Individual Curve with Lot# ),
Fit Logistic 4P( Test Parallelism ),
SendToReport(
Dispatch( {"Logistic 4P"}, "Plot", OutlineBox, {Close( 1 )} )
)
)
);
Wait( 0 );
rpt["Fit Curve", "Logistic 4P", "Group Summary", Table Box( 1 )] <<
Make Into Data Table;
rpt << Close Window;

 

Thanks very much for your help!

Chris

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Help with script to rename data table

try

current data table() << set name("4PL");
Jim

View solution in original post

8 REPLIES 8
jthi
Super User

Re: Help with script to rename data table

Here is an example using set name

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Nonlinear Examples/Bioassay.jmp");

fc = dt << Fit Curve(
	Y(:Toxicity),
	X(:log Conc),
	Group(:formulation),
	Fit Logistic 4P(Test Parallelism),
	SendToReport(Dispatch({"Logistic 4P"}, "Plot", OutlineBox, {Close(1)}))	
);

dt_logistics = Report(fc)["Fit Curve", "Logistic 4P", "Group Summary", Table Box(1)] << Make Into Data Table;
fc << Close Window;

dt_logistics << Set Name("4PL");
-Jarmo
ClusterFerret68
Level III

Re: Help with script to rename data table

Hi Jarmo,

 

Thanks for the response.  I've used the following for my case (data table is contained within a project file):

Names Default To Here(1);
dt = Open("jmpprj://contents/Test File.jmp");
 
fc = dt << Fit Curve(
Y(:Avg Response),
X(:"log Conc"n),
Group(:Individual Curve with Lot#),
Fit Logistic 4P(Test Parallelism),
SendToReport(Dispatch({"Logistic 4P"}, "Plot", OutlineBox, {Close(1)}))
);
 
dt_logistics = Report(fc)["Fit Curve", "Logistic 4P", "Group Summary", Table Box(1)] << Make Into Data Table;
fc << Close Window;
 
dt_logistics << Set Name("4PL");
 
When I run the script I get the following:
ClusterFerret68_0-1709649683302.png

 

Any thoughts?

Chris

txnelson
Super User

Re: Help with script to rename data table

My guess is that the Fit Curve is failing, and therefore, "fc" is not getting populated.  One item that could cause this is that either your X or Y columns are not set as Continuous. 

Jim
ClusterFerret68
Level III

Re: Help with script to rename data table

thanks Jim.

 

Both are continuous and the 4PL fit works if I do it independently.

 

Chris

txnelson
Super User

Re: Help with script to rename data table

Remove the 

fc << close window;

and then run the script again.  The error message is indicating the display output window can not be found.  If the window is closing faster than the Make Into Data Table, there could be an issue.

 

Also, you need to use the JSL icon at the top of the Preview window when entering JSL into your question, or responses.  It allows the reader to more easily examine your scripts.

Jim
ClusterFerret68
Level III

Re: Help with script to rename data table

Jim,

 

Thanks again...and thanks for your patience as I work to figure this out.

 

Tried your suggestion to no avail; still getting the same error msg.

FYI - I can run the following and it does the analysis and makes the Data Table...just doesn't rename it:

Names Default To Here( 1 );
rpt = New Window( "RM Tracking- CV - Fit Curve of Avg Response by log(Conc)",
	Data Table( "RM Tracking- CV" ) << Fit Curve(
		Y( :Avg Response ),
		X( :"log(Conc)"n ),
		Group( :Individual Curve with Lot# ),
		Fit Logistic 4P( Test Parallelism ),
		SendToReport(
			Dispatch( {"Logistic 4P"}, "Plot", OutlineBox, {Close( 1 )} )
		)
	)
);
Wait( 0 );
rpt["Fit Curve", "Logistic 4P", "Group Summary", Table Box( 1 )] <<
Make Into Data Table;
rpt << Set Name("4PL");

Chris

txnelson
Super User

Re: Help with script to rename data table

try

current data table() << set name("4PL");
Jim
pmroz
Super User

Re: Help with script to rename data table

dt = rpt["Fit Curve", "Logistic 4P", "Group Summary", Table Box( 1 )] <<
Make Into Data Table;
dt << Set Name("4PL");