Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
shasheminassab
Level III

How to save a summary table (and scripts within) back to the original table?

I make a summary table from an original table and within the summary table I create a bunch of graphs which I save their scripts to the table. Now how can I save this entire summary table (and scrips within) back to the original data table? I know it can be done with JSL but I'm not very familiar with scripting.

8 REPLIES 8
Highlighted
txnelson
Super User

Re: How to save a summary table (and scripts within) back to the original table?

I am assuming that you want to save the summary table and all of the scripts that you saved to the summary table, back to the original table, as a new table script for the original table.  This is an easy process.  Once you have run all of the graphs from the summary table, and save the scripts from those graphs back to the summary table, all you have to do, is to capture the script for the whole summary table, and then save it to the original table.

  1. Go to the Table Panel in the summary table and click on the red triangle and select Copy Table Scriptsave1.PNG
  2. Then go to the original data table's Table Panel and select New Scriptsave2.PNG
  3. Now, in the dialog box that pops up, paste in the data table script, and give the script a catchy name and you are complete       save3.PNG
Jim
Highlighted
shasheminassab
Level III

Re: How to save a summary table (and scripts within) back to the original table?

Thanks @txnelson. But when I update the original table with some new data and run the saved script (the one you just described), I get the old results. How to address this issue?

Highlighted
txnelson
Super User

Re: How to save a summary table (and scripts within) back to the original table?

Well, then what you seem to want is to not save the complete data table script, but to rather, save the script that reruns the summary table, and then runs the scripts that create the graphs.  Basically, all you need to do is to open a script window, and save the script that creates the summary table, and each of the scripts from each of the graphs, and then save that script to the original data table.  The script that creates the summary table, is available in the Source entry in the tables panel of the summary table.  Take that and save it to a script window.  Then rather than saving the scripts from each of the graphs you can specify to save to a script window.  Once the script is built, you simply save it as a new table script to the original data table.

Jim
Highlighted
shasheminassab
Level III

Re: How to save a summary table (and scripts within) back to the original table?

Thanks @txnelson . Very helpful. I followed the steps you described and saved the complied scripts (see below) in the original table. When I run it, it opens the summary table and ALL the graphs therein. Is there any way to control that? In other words, when i run the script I only want the summary table to open and then I open the graphs that I want in the summary table. Thanks again.

Data Table( "Beijing PM2.5" ) << Summary(
	Group(
		Transform Column(
			"Date[Date (LT)]",
			Format( "d/m/y", 22 ),
			Formula( Floor( :Name( "Date (LT)" ) / 86400 ) * 86400 )
		)
	),
	Mean( :Raw Conc. ),
	Freq( "None" ),
	Weight( "None" )
);

Graph Builder(
	Size( 514, 444 ),
	Show Control Panel( 0 ),
	Level Spacing Color( "White" ),
	Level Underline( 1 ),
	Page Level Fill Color( "Medium Light Gray" ),
	Page Level Frame Color( "Black" ),
	Page Level Underline( 0 ),
	Variables( X( :Name( "Date[Date (LT)]" ) ), Y( :Name( "Mean(Raw Conc.)" ) ) ),
	Elements( Bar( X, Y, Legend( 5 ) ) )
);

Graph Builder(
	Size( 514, 444 ),
	Show Control Panel( 0 ),
	Level Spacing Color( "White" ),
	Level Underline( 1 ),
	Page Level Fill Color( "Medium Light Gray" ),
	Page Level Frame Color( "Black" ),
	Page Level Underline( 0 ),
	Variables(
		X(
			Transform Column(
				"Year[Date[Date (LT)]]",
				Formula( Year( :Name( "Date[Date (LT)]" ) ) )
			)
		),
		Y( :Name( "Mean(Raw Conc.)" ) )
	),
	Elements( Bar( X, Y, Legend( 5 ) ) )
);
Highlighted
ron_horne
Super User

Re: How to save a summary table (and scripts within) back to the original table?

@shasheminassab 

what i would do is give a name to the subset in the script, then send the graphs to the table as scripts:

 

subdt = Data Table( "Beijing PM2.5" ) << Summary(
	Group(
		Transform Column(
			"Date[Date (LT)]",
			Format( "d/m/y", 22 ),
			Formula( Floor( :Name( "Date (LT)" ) / 86400 ) * 86400 )
		)
	),
	Mean( :Raw Conc. ),
	Freq( "None" ),
	Weight( "None" )
);

subdt << new script ("Graph builder 1",
Graph Builder(
	Size( 514, 444 ),
	Show Control Panel( 0 ),
	Level Spacing Color( "White" ),
	Level Underline( 1 ),
	Page Level Fill Color( "Medium Light Gray" ),
	Page Level Frame Color( "Black" ),
	Page Level Underline( 0 ),
	Variables( X( :Name( "Date[Date (LT)]" ) ), Y( :Name( "Mean(Raw Conc.)" ) ) ),
	Elements( Bar( X, Y, Legend( 5 ) ) )
)
);
subdt << new script ("Graph builder 2",
Graph Builder(
	Size( 514, 444 ),
	Show Control Panel( 0 ),
	Level Spacing Color( "White" ),
	Level Underline( 1 ),
	Page Level Fill Color( "Medium Light Gray" ),
	Page Level Frame Color( "Black" ),
	Page Level Underline( 0 ),
	Variables(
		X(
			Transform Column(
				"Year[Date[Date (LT)]]",
				Formula( Year( :Name( "Date[Date (LT)]" ) ) )
			)
		),
		Y( :Name( "Mean(Raw Conc.)" ) )
	),
	Elements( Bar( X, Y, Legend( 5 ) ) )
)
);


 

Highlighted
shasheminassab
Level III

Re: How to save a summary table (and scripts within) back to the original table?

Great! That's exactly what I was looking for @ron_horne.

Thanks

Highlighted

Re: How to save a summary table (and scripts within) back to the original table?

I know that this suggestion is not a direct answer to your original question, but it might offer a new direction that suits your needs. Take a look at JMP Projects. This framework allows you to simultaneously work with more than one data table and many projects in a very smooth way.

Learn it once, use it forever!
Highlighted
shasheminassab
Level III

Re: How to save a summary table (and scripts within) back to the original table?

Thanks @markbailey. I actually do use Project and I find it very helpful. However, I want to minimize the number of files that I save (in Project I need to save all of the tables separately if i want to use them later; let me know if there is a better way to handle it), that's why I was thinking about embedding the scripts into the original table so I save only one file instead of saving both the original and summary tables.

Article Labels

    There are no labels assigned to this post.