Thanks a lot!!
Using your support I performed the follows script:
- BTW, How can I add popup window to modify the red line?
@txnelson wrote:
Here is a simple script that will illustrate one way to do this
Names Default To Here( 1 );
dtOrig = Open( "$SAMPLE_DATA/Semiconductor Capability.jmp" );
// Modify the data to make it simpler for the example
dtOrig << delete columns( 10 :: 132 );
dtOrig << delete columns( 1 :: 4 );
dtOrig << select where( Row() > 50 );
dtOrig << delete rows;
// Stack the data
dtStacked = dtOrig << Stack(
columns( :NPN1, :PNP1, :PNP2, :NPN2, :PNP3 ),
Source Label Column( "Parameter" ),
Stacked Data Column( "Value" ),
Output Table( "Stacked" )
);
// Create the new columns
dtStacked << New Column( "Lower Spec Limit" );
dtStacked << New Column( "Upper Spec Limit" );
// Move the Spec Limits
colList = dtOrig << get column names( string );
For( i = 1, i <= N Items( colList ), i++,
specs = Column( dtOrig, colList[i] ) << get property( "spec limits" );
foundRows = dtStacked << get rows where( dtStacked:Parameter == colList[i] );
dtStacked:Lower Spec Limit[foundRows] = specs["LSL"];
dtStacked:Upper Spec Limit[foundRows] = specs["USL"];
);
// Stack the data
dtOrig = currentdatatable();
dtStacked = dtOrig << Stack(
columns( 26 :: 42 ),
Source Label Column( "Parameter" ),
Stacked Data Column( "Value" ),
Output Table( "Stacked" )
);
// Create the new columns
dtStacked << New Column( "Lower Spec Limit" );
dtStacked << New Column( "Upper Spec Limit" );
// Move the Spec Limits
colList = dtOrig << get column names( string );
For( i = 1, i <= N Items( colList ), i++,
specs = Column( dtOrig, colList[i] ) << get property( "spec limits" );
foundRows = dtStacked << get rows where( dtStacked:Parameter == colList[i] );
dtStacked:Lower Spec Limit[foundRows] = specs["LSL"];
dtStacked:Upper Spec Limit[foundRows] = specs["USL"];
);
New Column("P/F", Numeric, "Continuous", Formula((:Lower Spec Limit <= :Value <= :Upper Spec Limit) == 0));