The 2 places I see issues, are the
mean = dt1:Mean[dt1 << Get Rows Where( :Tests == name )];
and
measure = mean - Col Mean( If( dt2:Strips == dt2:Strips[r], Column( dt2, c ), . ) );
Here is a work around for the issues Check them out and see if the answers are correct
Names Default To Here( 1 );
start=today();
dt1 =Data table( "Reference data table.jmp" );
dt2 = Current data table(); /// Select Data table.jmp
For(i=1,i<=nrows(dt1),i++,
theTest = dt1:Tests[i];
try(column(dt2,theTest) << set property("TheMean", dt1:mean[i]));
);
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], "Currents" )| Contains( Col_List1[c], "Voltage" )| Contains( Col_List1[c], "Resistance" ),
//For( r = 1, r <= N Rows( dt2 ), r++,
For Each Row( r=row();
//mean = dt1:Mean[dt1 << Get Rows Where( :Tests == name )];
mean = column(dt2,col_list1[c]) << get property("theMean");
//measure = mean - Col Mean( If( dt2:Strips == dt2:Strips[r], Column( dt2, c ), . ) );
measure = mean - Col Mean(as Column( dt2, c ),:Strips);
theMatrix = theMatrix || Column( dt2, c )[r] + measure;
);
Column( dt2, c ) << Set Values( theMatrix );
););
show((start-today())/60);
Jim