cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
AJ
AJ
Level II

How to rename the default graph builder script in a data table ?

Below code generates a script for graph builder and is saved under the data table.

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
obj = Graph Builder(
	Variables( X( :Sex ), Y( :Height ), Group X( :Age ) ),
	Elements( Box Plot( X, Y ) )
);
obj << Save Script to Data Table;

The names of the graph builder objects are using the default naming pattern for this platform. How do I rename them to my choice? (I have attached a screen shot and the graph builder names are highlighted in yellow)

I have tried using "set name" before and after saving the script to the data table but it didn't work. 

Thanks in advance!

AJ

2 ACCEPTED SOLUTIONS

Accepted Solutions
David_Burnham
Super User (Alumni)

Re: How to rename the default graph builder script in a data table ?

It looks like the ability to add the name as an argument is a version 13 feature.

Here is a workaround:

obj << Save Script To Data Table;
lstNames = dt << Get Table Script Names;
dt << Rename Table Script( lstNames[NItems(lstNames)], "My Script" );
-Dave

View solution in original post

AJ
AJ
Level II

Re: How to rename the default graph builder script in a data table ?

Thanks a lot for your effort! This works perfect for me.

View solution in original post

4 REPLIES 4
David_Burnham
Super User (Alumni)

Re: How to rename the default graph builder script in a data table ?

Here's a couple of approaches.

 

First method, based directly on your code.  Just add an argument to the message:

 

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
obj = Graph Builder(
	Variables( X( :Sex ), Y( :Height ), Group X( :Age ) ),
	Elements( Box Plot( X, Y ) )
);
obj << Save Script to Data Table("My Script");

The second method, if you simply want to attacth the script with a name, but not execute it:

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Set Property("My Script,",	
	Graph Builder(
		Variables( X( :Sex ), Y( :Height ), Group X( :Age ) ),
		Elements( Box Plot( X, Y ) )
	);	
);
-Dave
AJ
AJ
Level II

Re: How to rename the default graph builder script in a data table ?

Dave, 

  Thanks for your response. I need to execute the script generated from graph builder and hence I tried  option 1.

obj << Save Script to Data Table("My Script");

Unfortunately, it still saves the script by the name "Graph builder" and not "My script".  For your information, I am using JMP 12. 

David_Burnham
Super User (Alumni)

Re: How to rename the default graph builder script in a data table ?

It looks like the ability to add the name as an argument is a version 13 feature.

Here is a workaround:

obj << Save Script To Data Table;
lstNames = dt << Get Table Script Names;
dt << Rename Table Script( lstNames[NItems(lstNames)], "My Script" );
-Dave
AJ
AJ
Level II

Re: How to rename the default graph builder script in a data table ?

Thanks a lot for your effort! This works perfect for me.