Here is a modification to the script that handles the 28 FAI's found in the data. It also adjusts the chart to compensate for the different number of columns found for each FAI.
Names Default To Here( 1 );
dt = Data Table( "44322.jmp" );
New Window( "Box Plot Compaire",
Excluded( Row State( 1 ) ) = 1;
Excluded( Row State( 2 ) ) = 1;
Excluded( Row State( 3 ) ) = 1;
For( i = 2, i < N Col() + 1, i++,
// determine the number of columns for the current FAI
nFAI = 1;
FAI = Word( 1, Column Name( i ), "." );
Try( If( Word( 1, Column Name( i + 1 ), "." ) == FAI, nFAI = 2 ) );
Try( If( Word( 1, Column Name( i + 2 ), "." ) == FAI, nFAI = 3 ) );
If(
nFAI == 3,
mybox = Graph Builder(
Size( 568, 458 ),
Show Control Panel( 0 ),
Variables(
X( As Column( Column Name( i ) ), Position( 1 ), Combine( "Parallel Merged" ) ),
X( As Column( Column Name( i + 1 ) ), Position( 1 ), Combine( "Parallel Merged" ) ),
X( As Column( Column Name( i + 2 ) ), Position( 1 ), Combine( "Parallel Merged" ) ),
Group X( Phase ),
Color( Phase )
),
Elements(
Box Plot( X( 1 ), X( 2 ), X( 3 ), Legend( 9 ) ),
Points( X( 1 ), X( 2 ), X( 3 ), Legend( 10 ) ),
Caption Box( X( 1 ), X( 2 ), X( 3 ), Legend( 11 ) )
),
SendToReport(
Dispatch(
{},
"",
ScaleBox,
{Min(
Col Min( Column( i ) ) - (Col Max( Column( i ) ) - Col Min( Column( i ) )) /
100
), Max(
Col Max( Column( i ) ) + (Col Max( Column( i ) ) - Col Min( Column( i ) )) /
100
), /*Inc( (col max(column(i)) - col min(column(i)))/100 ),*/ Minor Ticks( 1 ),
Add Ref Line(
Column( i )[1],
"Solid",
"Dark Red",
Eval Insert( "LSL ^column(i)[1]^" ),
1
), Add Ref Line(
Column( i )[2],
"Solid",
"Dark Red",
Eval Insert( "USL ^column(i)[2]^" ),
1
), Add Ref Line(
Column( i )[3],
"Solid",
"Dark Blue",
Eval Insert( "Target ^column(i)[3]^" ),
1
)}
)
)
);,
nFAI == 2,
mybox = Graph Builder(
Size( 568, 458 ),
Show Control Panel( 0 ),
Variables(
X( As Column( Column Name( i ) ), Position( 1 ), Combine( "Parallel Merged" ) ),
X( As Column( Column Name( i + 1 ) ), Position( 1 ), Combine( "Parallel Merged" ) ),
Group X( Phase ),
Color( Phase )
),
Elements(
Box Plot( X( 1 ), X( 2 ), X( 3 ), Legend( 9 ) ),
Points( X( 1 ), X( 2 ), X( 3 ), Legend( 10 ) ),
Caption Box( X( 1 ), X( 2 ), X( 3 ), Legend( 11 ) )
),
SendToReport(
Dispatch(
{},
"",
ScaleBox,
{Min(
Col Min( Column( i ) ) - (Col Max( Column( i ) ) - Col Min( Column( i ) )) /
100
), Max(
Col Max( Column( i ) ) + (Col Max( Column( i ) ) - Col Min( Column( i ) )) /
100
), /*Inc( (col max(column(i)) - col min(column(i)))/100 ),*/ Minor Ticks( 1 ),
Add Ref Line(
Column( i )[1],
"Solid",
"Dark Red",
Eval Insert( "LSL ^column(i)[1]^" ),
1
), Add Ref Line(
Column( i )[2],
"Solid",
"Dark Red",
Eval Insert( "USL ^column(i)[2]^" ),
1
), Add Ref Line(
Column( i )[3],
"Solid",
"Dark Blue",
Eval Insert( "Target ^column(i)[3]^" ),
1
)}
)
)
);,
mybox = Graph Builder(
Size( 568, 458 ),
Show Control Panel( 0 ),
Variables(
X( As Column( Column Name( i ) ), Position( 1 ), Combine( "Parallel Merged" ) ),
Group X( Phase ),
Color( Phase )
),
Elements(
Box Plot( X( 1 ), X( 2 ), X( 3 ), Legend( 9 ) ),
Points( X( 1 ), X( 2 ), X( 3 ), Legend( 10 ) ),
Caption Box( X( 1 ), X( 2 ), X( 3 ), Legend( 11 ) )
),
SendToReport(
Dispatch(
{},
"",
ScaleBox,
{Min(
Col Min( Column( i ) ) - (Col Max( Column( i ) ) - Col Min( Column( i ) )) / 100
), Max(
Col Max( Column( i ) ) + (Col Max( Column( i ) ) - Col Min( Column( i ) )) / 100
), /*Inc( (col max(column(i)) - col min(column(i)))/100 ),*/ Minor Ticks( 1 ),
Add Ref Line(
Column( i )[1],
"Solid",
"Dark Red",
Eval Insert( "LSL ^column(i)[1]^" ),
1
), Add Ref Line(
Column( i )[2],
"Solid",
"Dark Red",
Eval Insert( "USL ^column(i)[2]^" ),
1
), Add Ref Line(
Column( i )[3],
"Solid",
"Dark Blue",
Eval Insert( "Target ^column(i)[3]^" ),
1
)}
)
)
);
);
Myboxplot = mybox << report;
Myboxplot << save picture( FAI || ".emf", emf );
// Increase variable i if nFAI is greater than 1
i=i+nFAI-1;
);
);
Jim