Hi,
I have a jmp script that offsets the test results based upon the reference data table values.
It will:
1. Read data table and reference data table
2. Generate a new window to select site number,
3. Based on the user input (Site Number 1 or 2), align those data to the reference data table values
Take mean by wafer Id, apply the offset to the main data table
Here's the script: It doesn't produces expected output
Names Default To Here( 1 );
dt1 = Data Table( "Reference data table" );
dt2 = Current Data Table();
For( i = 1, i <= N Rows( dt1 ), i++,
theTest = dt1:Tests[i];
Try( Column( dt2, theTest ) << set property( "TheMean", dt1:mean[i] ) );
);
New window( "", modal,
ct = checkbox({"1","2"}),
Buttonbox ("Ok",
get = ct << Get Selected ();
)
);
sitenum = Transform Each({str}, get, Num(str));
Col_List1 = dt2 << Get Column Names( "String" );
For( c = 1, c <= N Col( dt2 ) - 1, c++,
theMatrix = [];
name = Column( Col_List1[c] ) << Get name;
If( Contains( Col_List1[c], "IL" ),
mean = .;
Try( mean = Column( dt2, col_list1[c] ) << get property( "theMean" ) );
// Don't process if a value for theMean does not exist
If( Is Missing( mean ) == 0,
For Each Row(
If( Contains(sitenum, dt2:SiteNumber), // Something needs to be changed here *****
r = Row();
//mean = dt1:Mean[dt1 << Get Rows Where( :Tests == name )];
//measure = mean - Col Mean( If( dt2:Strips == dt2:Strips[r], Column( dt2, c ), . ) );
measure = mean - Col Mean( As Column( dt2, c ), :Wafer ID );
theMatrix = theMatrix || Column( dt2, c )[r] + measure;
);
);
Column( dt2, c ) << Set Values( theMatrix );
);
);
);