Changing column values based on the column spec limitWe have a phase test that sometimes likes to flop the value by 360 degrees. I would like a script that can look through the table column data, take an average and then compare it to the LSL / USL. If the sign of the average is opposite the spec limit add 360 to that value.
I can't do a blanket If( :test < 0, t1 = :column + 360; t1; ) due to the way the tester handles the data.
I have attached a sample table and the last two columns are where my issue is.
Thanks in advance
Data TableScriptingRe: Changing column values based on the column spec limitSee if this little script gives you what you want
Names Default To Here( 1 );
dt = Current Data Table();
colList = dt << get column names( continuous, string );
For( i = 1, i <= N Items( colList ), i++,
specs = Column( dt, colList[i] ) << get property( "spec limits" );
If( Is Missing( specs["LSL"] ) == 0 & Is Missing( specs["USL"] ) == 0,
If( !(specs["LSL"] <= Col Mean( Column( dt, colList[i] ) ) <= specs["USL"]),
For Each Row( As Column( dt, colList[i] ) = -1 * As Column( dt, colList[i] ) )
)
);
);