cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
New to using JMP? Hit the ground running with the Early User Edition of Discovery Summit. Register now, free of charge.
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
Choose Language Hide Translation Bar
JC7
JC7
Level I

How do I combine these codes?

Hi there,

 

I would like to combine these codes so that they run from the "Formulation Change Review (new)" and closes the new data table/tabulate tab only leaving the graph.

 

Any help much appreciated!

 

(Data Table( "Formulation Change Review (new)" ) <<
Tabulate(
	Add Table(
		Column Table( Grouping Columns( :Lab RFT ), Statistics( Row % ) ),
		Row Table( Grouping Columns( :Grade ) )
	)
)) << Make Into Data Table


Graph Builder(
	Size( 1896, 951 ),
	Show Control Panel( 0 ),
	Show Legend( 0 ),
	Variables(
		X(
			:Grade,
			Order By( :Name( "Row %(Y)" ), Ascending, Order Statistic( "Mean" ) )
		),
		Y( :Name( "Row %(Y)" ) ),
		Overlay( :Grade )
	),
	Elements( Bar( X, Y, Legend( 6 ), Label( "Label by Value" ) ) ),
	SendToReport(
		Dispatch( {}, "graph title", TextEditBox, {Set Text( "RFT % per grade" )} ),
		Dispatch( {}, "Y title", TextEditBox, {Set Text( "RFT%" )} )
1 REPLY 1
Craige_Hales
Super User

Re: How do I combine these codes?

untested, but split it up into smaller blocks like this:

dt1 = Data Table( "Formulation Change Review (new)" );

tab = (dt1 << Tabulate(
	Add Table(
		Column Table( Grouping Columns( :Lab RFT ), Statistics( Row % ) ),
		Row Table( Grouping Columns( :Grade ) )
	)
)) ;

dt2 = tab << Make Into Data Table;

gb = dt2 << Graph Builder(
	Size( 1896, 951 ),
	Show Control Panel( 0 ),
	Show Legend( 0 ),
	Variables(
		X(
			:Grade,
			Order By( :Name( "Row %(Y)" ), Ascending, Order Statistic( "Mean" ) )
		),
		Y( :Name( "Row %(Y)" ) ),
		Overlay( :Grade )
	),
	Elements( Bar( X, Y, Legend( 6 ), Label( "Label by Value" ) ) ),
	SendToReport(
		Dispatch( {}, "graph title", TextEditBox, {Set Text( "RFT % per grade" )} ),
		Dispatch( {}, "Y title", TextEditBox, {Set Text( "RFT%" )} );

tab<<closewindow;
close(dt2,nosave);

// gb is the handle to the graphbuilder report

edit: There appear to be missing ) at the end of the graph builder section. Make sure you grab all of the JSL from the save-to-script-window when you paste it together. 

edit 2: just before the close(dt2,nosave) you might want to

gb << journal;
gb<<closewindow;

because the graph builder report needs the table open but the journal is self contained. The journal'd graph is not connected to the data and can't do row selection.

Craige