cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.

Get the free JMP Student Edition for qualified students and instructors at degree granting institutions.

Choose Language Hide Translation Bar
SamKing
Level III

Embedding a table script into a table that is generated by an embedded table script

I have a script that adds some embedded table scripts for graphing. I'm now trying to add another table script that creates a summarized table and embeds a new table script inside that new table. 

So the embedded table in dt runs fine, opens dtsum as expected except "secondary table script title" does not embed into dtsum. If I run that portion of the script (CTL+R) then it embeds to dtsum.

 

Note that I have sanitized the script to hide some company IP stuff. Are you able to see something wrong with my format/structure?

 

 

dt << New Script(
	"First level Table script title",
	dtsum = dt << Summary(
				// summary details
			),
	dtsum << New Script(
		"Secondary table script title",
		// graph builder details here
	)
);

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Embedding a table script into a table that is generated by an embedded table script

Add the table script to dt_sum in same table script as you create the summary. It might be enough if you just replace , with ;.

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << Delete scripts(dt << Get Table Script Names); // has many of these already

dt << New Script("Create Summary", 
	Names Default To Here(1); 

	dt_sum = Current Data Table() << Summary(
		Group(:name),
		Mean(:height),
		Mean(:weight),
		Freq("None"),
		Weight("None"),
		Link to original data table(0)
	);
	
	dt_sum << New Script("Plot",
		Graph Builder(
			Size(528, 458),
			Show Control Panel(0),
			Variables(X(:name), Y(:"Mean(height)"n), Y(:"Mean(weight)"n, Position(1))),
			Elements(Bar(X, Y(1), Y(2), Legend(4)))
		)
	)
);
-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: Embedding a table script into a table that is generated by an embedded table script

Add the table script to dt_sum in same table script as you create the summary. It might be enough if you just replace , with ;.

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << Delete scripts(dt << Get Table Script Names); // has many of these already

dt << New Script("Create Summary", 
	Names Default To Here(1); 

	dt_sum = Current Data Table() << Summary(
		Group(:name),
		Mean(:height),
		Mean(:weight),
		Freq("None"),
		Weight("None"),
		Link to original data table(0)
	);
	
	dt_sum << New Script("Plot",
		Graph Builder(
			Size(528, 458),
			Show Control Panel(0),
			Variables(X(:name), Y(:"Mean(height)"n), Y(:"Mean(weight)"n, Position(1))),
			Elements(Bar(X, Y(1), Y(2), Legend(4)))
		)
	)
);
-Jarmo
SamKing
Level III

Re: Embedding a table script into a table that is generated by an embedded table script

Looks like your last sentence was correct, I just needed to replace the , with ;

I thought my format was good and that I had something more broken than that, I appreciate the quick response! Thanks!

Recommended Articles