The script is looking for a specific Outline Box with the title, in English, of "Individual Measurement of Acid". Your output is obviously not in English. The below script changes the reference to Outline Box(2). This is an absolute reference to the outline box, while "Individual Measurement of Acid" is a relative reference. You could also try replacing "Individual Measurement of Acid" with
Names Default To Here( 1 );
// Open the sample data table
dt = Open( "$SAMPLE_DATA\Quality Control\Pickles.jmp" );
// There isn't an adequate column to be used as a Phase column in the sample
// data table, so create one
dt << New Column( "MyPhase", character, formula( Char( Floor( Row() / 13 + 1 ) ) ) );
// Run the control Chart
ct = dt << Control Chart(
Phase( :MyPhase ),
Group Size( 1 ),
KSigma( 3 ),
Chart Col( :Acid, Individual Measurement( Phase Level( "1" ), Phase Level( "2" ) ), Moving Range( Phase Level( "1" ), Phase Level( "2" ) ) )
);
// Create a list called byPhase of the each of the Phase values
Summarize( dt, byPhase = by( :MyPhase ) );
// Find the max row for each phase to determine the X position on the chart
// for the placement of the text values
PhaseMaxRowList = {};
For( i = 1, i <= N Items( byPhase ), i++,
Insert Into( PhaseMaxRowList, Max( dt << get rows where( :MyPhase == byPhase[i] ) ) )
);
// Add the text to the chart
framebox = Report( ct )[frame box( 1 )];
addTxt = Expr(
framebox << Add Graphics Script(
Description( scriptNameTBD ),
Text Color( "Black" );
Text( Center Justified, {xTBD - 2, yTBD + .1}, txtTBD );
);
);
// Loop across the phases and add the 3 text values by pulling their values from the table
// and reformating the values
For( i = 1, i <= N Items( byPhase ), i++,
LCL = (Report( ct )[Outline Box(2)][Number Col Box( i )] << get)[1];
LCLtxt = "LCL=" || Format( LCL, "Fixed Dec", 5, 2 );
Avg = (Report( ct )[Outline Box(2)][Number Col Box( i + N Items( byPhase ) )] << get)[1];
Avgtxt = "Avg=" || Format( Avg, "Fixed Dec", 5, 2 );
UCL = (Report( ct )[Outline Box(2)][Number Col Box( i + (N Items( byPhase ) * 2) )] << get)[1];
UCLtxt = "UCL=" || Format( UCL, "Fixed Dec", 5, 2 );
// Use a separate graphics script for each annotation so that they are more easily moved 'by hand'
Eval(Substitute(NameExpr(addTxt), Expr(scriptNameTBD), "LCL Text "||Char(i), Expr(xTBD), PhaseMaxRowList[i], Expr(yTBD), LCL, Expr(txtTBD), LCLtxt));
Eval(Substitute(NameExpr(addTxt), Expr(scriptNameTBD), "Avg Text "||Char(i), Expr(xTBD), PhaseMaxRowList[i], Expr(yTBD), Avg, Expr(txtTBD), Avgtxt));
Eval(Substitute(NameExpr(addTxt), Expr(scriptNameTBD), "UCL Text "||Char(i), Expr(xTBD), PhaseMaxRowList[i], Expr(yTBD), UCL, Expr(txtTBD), UCLtxt));
);
Jim