I ran my script with your summary table under JMP 12.2 and it ran without error. Below is the script that includes your summary table, and my reworked script
Names Default To Here( 1 );
//Open("Summary.jmp");
dtsumm = New Table( "Summary",
Add Rows( 6 ),
New Column( "Lot",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [1, 2, 3, 4, 5, 6] )
),
New Column( "Param1_Q50",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [-3, 7, 8, -12, 5, 0] )
),
New Column( "Param1_StdDev",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [0.2, 1, 0.6, 2, 0.2, 0.3] )
),
New Column( "Param2_Q50",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [23, 18, 54, 62, 78, 45] )
),
New Column( "Param2_StdDev",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [0.9, 1.2, 7, 3.6, 4.2, 1] )
)
);
// Run the script
GraphXSize = 800;
GraphYSize = 600;
ParamsList = {{"Param1", "Name1", 0, -10, 10},
{"Param2", "Name2", 50, 25, 75}};
ParamGraph = Function( {parameter, title, tgt = ., lsl = ., usl = .},
Local( {Default Local},
medianCol = parameter || "_Q50";
stdevCol = parameter || "_StdDev";
Eval(
Substitute(
Expr(
gb = dtSumm << Graph Builder(
Size( __GraphXSize__, __GraphYSize__ ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Show Footer( 0 ),
Variables( X( :lot ), Y( __Q50__ ), Y( __Std__ ), Color( :lot ) ),
Elements( Position( 1, 1 ), Points( X, Y, Legend( 6 ) ) ),
Elements( Position( 1, 2 ), Points( X, Y, Legend( 7 ) ) ),
SendToReport(
Dispatch( {}, "graph title", TextEditBox, {Set Text( __title__ )} ),
Dispatch( {}, "Y title", TextEditBox, {Set Text( "Median" )} ),
Dispatch( {}, "Y 1 title", TextEditBox, {Set Text( "Std Dev" )} )
)
)
),
Expr( __GraphXSize__ ), GraphXSize,
Expr( __GraphYSize__ ), GraphYSize,
Expr( __Q50__ ), Parse( MedianCol ),
Expr( __Std__ ), Parse( stdevCol ),
Expr( __Title__ ), title
)
);
If( Is Missing( tgt ) == 0,
report(gb)[AxisBox( 3 )] << Add Ref Line( tgt, "Solid", Black, "TARGET", 1 )
);
If( Is Missing( lsl ) == 0,
report(gb)[AxisBox( 3 )] << Add Ref Line( lsl, "Solid", Purple, "LSL", 1 )
);
If( Is Missing( usl ) == 0,
report(gb)[AxisBox( 3 )] << Add Ref Line( usl, "Solid", Red, "USL", 1 )
);
)
);
New Window( "Summary - Report",
For( i = 1, i <= Length( ParamsList ), i++,
ParamGraph( ParamsList[i][1], ParamsList[i][2], ParamsList[i][3], ParamsList[i][4], ParamsList[i][5] )
)
) << Set Window Icon( "Trellis" );
Jim