Hi @peter_t ,
This might not be the most elegant way of going about your solution, but for each of the processes that you are running this on, you can check if the standard deviation is 0, and if so, set the Boolean value for showing performing a test and/or the alarm report to 0. You could also wrap the entire control chart in a Boolean such that if the test value is 0 then you don't perform the control chart -- since a control chart doesn't really make sense for a process that is always constant. Anyway, take a look at the code below and see how I substitute in the test value Boolean TestV.
Names Default To Here( 1 );
// Make data table with no variation and set spec limits
dt = New Table( "Control chart data", Add Rows( 20 ), New Column( "x", Numeric, "Continuous" ) );
dt:x << Set Each Value( 0.1 );
dt:x << Set Property( "Spec Limits", {LSL( 0 ), USL( 1 ), Show Limits( 1 )} );
//test if standard deviation is 0, if so, set test value to 0
xstdev = Col Std Dev( :x );
If( xstdev == 0,
TestV = 0,
TestV = 1
);
// Make Individual control chart with Test 1
dt << Control Chart Builder(
Show Two Shewhart Charts( 0 ),
Show Control Panel( 0 ),
Eval( Substitute( Expr( Show Alarm Report( _Test_V ) ), Expr( _TestV_ ), TestV ) ),
Variables( Y( :x ) ),
Eval(
Substitute(
Expr(
Chart(
Points( Statistic( "Individual" ) ),
Limits( Sigma( "Levey Jennings" ), Spec Limits( 0 ) ),
Warnings( Test 1( (Expr( _TestV_ )) ) )
)
),
Expr( _TestV_ ), TestV
)
)
);
Hope this helps!,
DS
P.S. I had to change the Set Each Value command in your code so that it correctly populated the rows.