Tengo una fórmula de columna que prueba un producto que puede pasar o fallar según los límites de especificación. Se utiliza una matriz asociativa para hacer referencia a un límite alto y bajo de diferentes especificaciones del producto. El problema que tengo es que el usuario selecciona las especificaciones del producto que desea importar en la columna de aprobación/rechazo. Son diferentes cada vez, después de referenciarse desde una tabla de datos diferente. El objetivo es hacer que la columna de fórmula itere a través de la lista de especificaciones solicitadas, verificando si cada una está dentro de los límites. Si es así, se atribuirá una clasificación general de aprobado/reprobado. Haría esto fuera de la columna de fórmula, pero una parte posterior del script actualizará esa columna de fórmula repetidamente para continuar con el análisis de aprobación y falla al cambiar las tolerancias de límite de especificación. Creo que todo el cálculo debería estar en la fórmula de la columna.
He adjuntado dos tablas de datos y el script de trabajo en progreso a continuación.
Names Default To Here(1);
//declare associative array for specs
specs = Associative Array();/*
//input limits file
LimitsCSV = Pick File(
"Select The Appropriate Spec Limit Table",
"filepath"//Insert file path here.
);
//open limits file in JMP
LimitsTable = open( LimitsCSV, invisible);
//Open Current Product Testing Data
DataTable = Pick File(
"Select The Current Product Testing Data",
"filepath"// Insert File Path Here
);
//set testing data to be able to manipulate in JMP
GraphingTable = open(DataTable);
//Select the Specs you want to compare by using a COL LIST BOX
ListNumericCols = GraphingTable << Get Column Names(numeric);
New Window("Select Wanted Specifications", << Modal,
clb = Col List Box (<< Set Items (ListNumericCols))
);
ListSpecNames = clb << Get Selected;
show(ListSpecNames); //Display for testing
//insert spec names into associative array
for (i=1,i< (N Items(ListSpecNames) + 1), i++,
Insert Into(specs, ListSpecNames[i]);
ColSpec = Column(LimitsTable, 1); //1 is the coolumn for spec name
LimitList= {};
//Insert Lower Limit onto
for(j=1, j < (nrows(LimitsTable)+1), j++,
if (ColSpec[j] == ListSpecNames[i],
ColLimit = Column(LimitsTable, 2);//14 is the column for lower limit
MinVal = 0;
if(ColLimit[j] > 0, MinVal = ColLimit[j] / 2, MinVal = ColLimit[j]*2);
InsertInto(LimitList, MinVal );
break();
));
for(k=1, k < (nrows(LimitsTable)+1), k++,
if (ColSpec[k] == ListSpecNames[i],
ColLimit = Column(LimitsTable, 2);//14 is the column for lower limit
InsertInto(LimitList, ColLimit[k]);
break();
));
for(l=1, l < (nrows(LimitsTable)+1), l++,
if (ColSpec[l] == ListSpecNames[i],
ColLimit = Column(LimitsTable, 3);//14 is the column for lower limit
InsertInto(LimitList, ColLimit[l]);
break();
));
for(m = 1, m < (nrows(LimitsTable)+1), m++,
if (ColSpec[m] == ListSpecNames[i],
ColLimit = Column(LimitsTable, 3);//14 is the column for upper limit
MaxVal = 0;
if(ColLimit[m] > 0, MaxVal = ColLimit[m] *2, MaxVal = ColLimit[m] /2 );
InsertInto(LimitList, MaxVal );
break();
)
);
specs[ListSpecNames[i]] = LimitList
);
close(LimitsTable, no save);
PassBool = 1;
ColNameList = GraphingTable << get column names(string);
newcolumn = "Pass/Fail";
if (!contains(ColNameList, NewColumn),
GraphingTable << new column("Pass/Fail"));/*
if(((column("m1") >= specs["m1"][2]) & (column("m2") <= specs["m2"][3])),
show("Pass"),
show("Fail")
);*/
Column(GraphingTable, "Pass/Fail") << Set Formula(
//counter = 0;
for(i=1,i< (N Items(ListSpecNames) + 1), i++,
if((Column(ListSpecNames[i]) >= specs[ListSpecNames[i]][2]) & (Column(ListSpecNames[i]) <= specs[ListSpecNames[i]][3]),
show("Pass"),
show("Fail");
PassBool = 0;
break();
)
) ;
If(PassBool == 1, "Pass","Fail")
);
show(specs);y mi script jsl a continuación.