I am trying to get a Yield table using a table having embedded spec limits.
For some reason the count of rows part isn't giving anything but zero. Any clue what I'm doing wrong
Clear Globals();
dt = Current Data Table();
dtYield = New Table( "Yield Table",
New Column( "Column Name", Character, "Nominal" ),
New Column( "Pass Count", Numeric, "Continuous" ),
New Column( "Fail Count", Numeric, "Continuous" ),
New Column( "Yield (Percent)", Numeric, "Continuous", Format( "Percent", 12 ) )
);
// Get all numeric columns
colList = dt << get column names( numeric, string );
// Loop across the columns and generate the test pass/fails
Try(For( i = 1, i <= N Items( colList ), i++,
spec = As Column( dt, colList[i] ) << get property( "Spec Limits" );
//Establish the Notes Value from the Parent Column
dt << clear select;
If( !Is Empty( specs ),
/* Extract spec limits */
lsl = spec["LSL"]; // Lower Spec Limit
usl = spec["USL"]; // Upper Spec Limit
/* Step 5: Evaluate pass and fail counts */
failCount = N Rows( dt << Get Rows Where( Column(dt, colList[i]) <= lsl)) + N Rows( dt << Get Rows Where( Column(dt, colList[i]) >= usl));
passCount = N Rows( dt << Get Rows Where( Column(dt, colList[i]) > lsl & Column(dt, colList[i]) < usl ) );
/* Step 6: Calculate yield */
yield = 100 * passCount / (passCount + failCount);
Show(yield);
/* Step 7: Add results to the yield table */
dtYield << Add Rows(1);
dtYield:Column Name[ N Rows( dtYield ) ] = As Column(colList[i]) << Get Name();
dtYield:Pass Count[ N Rows( dtYield ) ] = passCount;
dtYield:Fail Count[ N Rows( dtYield ) ] = failCount;
dtYield:Yield (Percent)[ N Rows( dtYield ) ] = yield;
);
);<BR />);