bucle de la función de capacidad de procesoEstoy tratando de hacer un bucle a través de un montón de nombres de columna seleccionados por el usuario (col_name)
luego, desde esa lista, el código se ejecutará para cada columna individual
el problema es que no puedo hacer que el JMP lea el nombre de col [i] como una columna, simplemente lo lea como una cadena
y el estado de la columna no se puede encontrar en la tabla de datos
/*****************************************************
*********************** Cpk *********************
*****************************************************/
cpk =expr(
for (k=1,k<=n items(col_name),k++
Process Capability(
Process Variables( col_name[i]) ),
Individual Detail Reports( 1 ),
Capability Box Plots( 0 ),
Goal Plot( 0 ),
Capability Index Plot( 0 ),
{choice[i] << Process Capability Analysis( Histogram( 0 ) )},
Where( :Config == config[k] )
))
);Re: bucle la función de capacidad de procesohola, adjunta es una versión simplificada de los datos en bruto utilizados
Re: bucle la función de capacidad de procesoPor favor, proporcione algunos datos de muestra para ayudar a depurar el problema.
Re: bucle la función de capacidad de procesoparece que no funciona, intenté imprimir la configuración subituted, parece
Pero el nombre de la salida todavía no ha cambiado
CPK = Expr(
v list box(
For( i = 1, i <= N Items( choices ), i++,
For( j = 1, j <= N Items( Config ), j++,
;
Eval(
Substitute(
Expr(
Process Capability(
Process Variables( As Column( choices[i] ) ),
Spec Limits(
__choices__(
LSL( FAI_SPECS[choices[i] || " LSL"] ),
Target( FAI_SPECS[choices[i] || " Nominal"] ),
USL( FAI_SPECS[choices[i] || " USL"] )
)
),
Individual Detail Reports( 1 ),
Capability Box Plots( 0 ),
Goal Plot( 0 ),
Capability Index Plot( 0 ),
{__choices__ << Process Capability Analysis( Histogram( 0 ) )},
Where( :Config == config[j] );//"P1_41_PBO")///":name(\!"" || Config[j] || "\!")")
SendToReport(
Dispatch(
{},
"Individual Detail Reports",
OutlineBox,
{Set Title( __YourConfig__ )}
)
);
);
print(__YourConfig__);
),
Expr( __choices__ ), Parse( ":name(\!"" || choices[i] || "\!")" ),
Expr( __YourConfig__ ), Char( Config[j] )
)
)
;
)
)
)
);Re: bucle la función de capacidad de procesoAquí hay una expansión simple en la función Substitute () que debería darle los resultados que desea.
CPK = Expr(
For( i = 1, i <= N Items( choices ), i++,
For( j = 1, j <= N Items( Config ), j++,
Print( choices );
Eval(
Substitute(
Expr(
Process Capability(
Process Variables( As Column( choices[i] ) ),
Spec Limits(
__choices__(
LSL( FAI_SPECS[choices[i] || " LSL"] ),
Target( FAI_SPECS[choices[i] || " Nominal"] ),
USL( FAI_SPECS[choices[i] || " USL"] )
)
),
Individual Detail Reports( 1 ),
Capability Box Plots( 0 ),
Goal Plot( 0 ),
Capability Index Plot( 0 ),
{__choices__ << Process Capability Analysis( Histogram( 0 ) )},
Where( :Config == config[j] );//"P1_41_PBO")///":name(\!"" || Config[j] || "\!")")
SendToReport(
Dispatch(
{},
"Individual Detail Reports",
OutlineBox,
{Set Title( __YourConfig__ )}
)
);
)
),
Expr( __choices__ ), Parse( ":name(\!"" || choices[i] || "\!")" ),
Expr( __YourConfig__ ), Char( Config[j] )
)
)
;
)
)
);Re: bucle la función de capacidad de procesoHola señor,
Gracias por su paciencia para ayudarme con este script jsl
No podría haberlo hecho sin ti.
Solo un ajuste más para este script.
¿Cómo configuro el título?
CPK = Expr(
For( i = 1, i <= n items(choices), i++,
for(j=1,j<=n items(Config),j++,
print(choices);
Eval(
Substitute(
Expr(
Process Capability(
Process Variables(as column(choices[i])) ,
Spec Limits( __choices__( LSL(FAI_SPECS[choices[i] || " LSL"] ), Target( FAI_SPECS[choices[i] || " Nominal"] ), USL( FAI_SPECS[choices[i] || " USL"] ) ) ),
Individual Detail Reports( 1 ),
Capability Box Plots( 0 ),
Goal Plot( 0 ),
Capability Index Plot( 0 ),
{ __choices__ << Process Capability Analysis( Histogram( 0 ) )},
Where( :Config ==config[j]);//"P1_41_PBO")///":name(\!"" || Config[j] || "\!")")
SendToReport(
Dispatch(
{},
"Individual Detail Reports",
OutlineBox,
{Set Title( "To the same as config[j]" )}
)
)
)
),
Expr( __choices__ ), Parse( ":name(\!"" || choices[i] || "\!")" )
)
)
)
)
);Re: bucle la función de capacidad de procesoCon el complejo nombre de columna que tiene, JMP necesita ayuda para analizarlo correctamente. La función: Nombre () debe usarse para mostrar el nombre como un nombre y no como algo que necesita ser ejecutado.
CPK = Expr(
For( i = 1, i <= N Items( choices ), i++,
Print( choices );
Eval(
Substitute(
Expr(
Process Capability(
Process Variables( As Column( choices[i] ) ),
Spec Limits( __choices__( LSL( 400 ), Target( 425 ), USL( 450 ) ) ),
Individual Detail Reports( 1 ),
Capability Box Plots( 0 ),
Goal Plot( 0 ),
Capability Index Plot( 0 ),
{__choices__ << Process Capability Analysis( Histogram( 0 ) )},
Where( :Config=="P1_A1_MBO" )
);
Print( "choice: _", __choices__, "_chhoice" );
),
Expr( __choices__ ), Parse( ":name(\!"" || choices[1] || "\!")" )
)
);
)
);
dt=current data table();
choices = { "FAI 37_SPC AK R14 Thickness R14 top - Cu Surface","Filling VIM Total Thickness" };
new window("jo",V list box(cpk));Re: bucle la función de capacidad de procesoEl código funcionó en la tabla de datos de ejemplo, pero cuando lo probé con mis datos, me dieron este error.
el adjunto es mostrar que los datos im tratando de tirar
CPK = Expr(
For( i = 1, i <= N Items( choices ), i++,
Print( choices );
Eval(
Substitute(
Expr(
Process Capability(
Process Variables( As Column( choices[i] ) ),
Spec Limits( __choices__( LSL( 400 ), Target( 425 ), USL( 450 ) ) ),
Individual Detail Reports( 1 ),
Capability Box Plots( 0 ),
Goal Plot( 0 ),
Capability Index Plot( 0 ),
{__choices__ << Process Capability Analysis( Histogram( 0 ) )},
Where( :Config==P1_A1_MBO )
);
Print( "choice: _", __choices__, "_chhoice" );
),
Expr( __choices__ ), Parse( ":" || choices[1] )
)
);
)
);
dt=current data table();
choices = { "FAI 37_SPC AK R14 Thickness R14 top - Cu Surface","Filling VIM Total Thickness" };
new window("jo",V list box(cpk));{"FAI 37_SPC AK R14 Grosor R14 superior - Superficie Cu", "Llenado de VIM Grosor Total"}
Nombre no resuelto: Config {1} en el acceso o evaluación de 'Config',: Config / * ### * /
Esta cláusula Where para la tabla de datos 'FAI_Spec 2' no produjo filas:: Config == P1_A1_MBO
"elección: _"
Nombre no resuelto: FAI 37_SPC AK R14 Grosor R14 arriba {1} en acceso o evaluación de 'FAI 37_SPC AK R14 Grosor R14 arriba',: FAI 37_SPC AK R14 Grosor R14 arriba / * ### * /
Re: bucle la función de capacidad de procesoAquí hay una tabla de datos simplificada junto con el código que proporcionó, y en mi sistema, se ejecuta sin errores, incluidas sus declaraciones de impresión
dt = New Table( "Example",
Add Rows( 40 ),
New Column("config",
Character( 1 ),
Set Values(
{"P1_31_PBO", "P1_31_PBO", "P1_31_PBO", "P1_31_PBO", "P1_31_PBO", "M", "M", "M", "P1_31_PBO", "P1_31_PBO", "P1_31_PBO", "M", "M", "M",
"M", "P1_31_PBO", "P1_31_PBO", "P1_31_PBO", "P1_31_PBO", "P1_31_PBO", "M", "M", "M", "M", "M", "M", "M", "P1_31_PBO",
"P1_31_PBO", "M", "M", "M", "M", "M", "P1_31_PBO", "P1_31_PBO", "M", "P1_31_PBO", "M", "M"}
)
),
New Column("height",
Set Values(
[59, 61, 55, 66, 52, 60, 61, 51, 60, 61, 56, 65, 63, 58, 59, 61, 62, 65,
63, 62, 63, 64, 65, 64, 68, 64, 69, 62, 64, 67, 65, 66, 62, 66, 65, 60,
68, 62, 68, 70]
)
)
);
CPK = Expr(
For( i = 1, i <= N Items( choices ), i++,
Print( choices );
Eval(
Substitute(
Expr(
Process Capability(
Process Variables( As Column( choices[i] ) ),
Spec Limits( __choices__( LSL( 400 ), Target( 425 ), USL( 450 ) ) ),
Individual Detail Reports( 1 ),
Capability Box Plots( 0 ),
Goal Plot( 0 ),
Capability Index Plot( 0 ),
{__choices__ << Process Capability Analysis( Histogram( 0 ) )},
Where( :Config == "P1_31_PBO" )
);
Print( "choice: _", __choices__, "_chhoice" );
),
Expr( __choices__ ), Parse( ":" || choices[1] )
)
);
)
);
dt=current data table();
choices = { "height" };
cpk;Re: bucle la función de capacidad de proceso CPK = Expr(
For( i = 1, i <= n items(choices), i++,
print(choices);
Eval(
Substitute(
Expr(
Process Capability(
Process Variables(as column(choices[i]) ),
Spec Limits( __choices__( LSL( 400 ), Target( 425 ), USL( 450 ) ) ),
Individual Detail Reports( 1 ),
Capability Box Plots( 0 ),
Goal Plot( 0 ),
Capability Index Plot( 0 ),
{ __choices__ << Process Capability Analysis( Histogram( 0 ) )},
Where( :Config == "P1_31_PBO" )
);
print("choice: _",__choices__,"_chhoice")
),
Expr( __choices__ ), Parse(":" || choices[1] )
)
)
)
);Intenté usar la impresión para ver qué da, pero sigo recibiendo un error "desconocido"
Re: bucle la función de capacidad de procesoPara agregar a la recomendación de Jim, este caso sería un buen momento para usar el depurador para examinar o observar sus variables a medida que avanza a través de líneas o en puntos de ruptura.
Re: bucle la función de capacidad de procesoLe sugiero que pase por los valores de "i" y verifique qué código se está produciendo desde la función Sustitución () para cada valor de "i"; Entonces deberías ver por qué el código no funciona para ciertos valores de "i"
Re: bucle la función de capacidad de proceso///BOX PLOT///
boxplot=expr(
data_filtering;
choices=choice<<GETKEYS></GETKEYS><BR />
//BOX PLOT inner expression//
box_plot_inner_expr=expr(
for(i=1,i<=n items(choices),i++,
FAI_USL=Fai_specs[concat(choices[i]," USL")];
FAI_LSL=Fai_specs[concat(choices[i]," LSL")];
FAI_target=Fai_specs[concat(choices[i]," Nominal")];
print(FAI_USL);
Oneway(
Y(choices[i]),
X( :Config),
All Pairs(
1,
Confidence Quantile( 0 ),
LSD Threshold Matrix( 0 ),
Connecting Letters Report( 0 ),
Ordered Differences Report( 0 )
),
Comparison Circles( 0 ),
Means and Std Dev( 1 ),
Box Plots( 1 ),
Mean Error Bars( 1 ),
Std Dev Lines( 1 ),
Connect Means( 1 ),
Points Jittered( 1 ),
SendToReport(
Dispatch(
{},
OutlineBox,
{
}
),
Dispatch(
{},
"1",
ScaleBox,
{Min( FAI_LSL-10 ), Max(FAI_USL+10 ), Inc( 5 ), Minor Ticks( 1 ),
Add Ref Line( FAI_LSL, "Dashed", "Medium Dark Red", "LSL", 1 ),
Add Ref Line( FAI_USL, "Dashed", "Medium Dark Red", "USL", 1 ),
Add Ref Line( FAI_target, "Dashed", "Dark Green", "Target", 1 )}
),
Dispatch(
{},
"Oneway Plot",
FrameBox,
{Frame Size( 347, 229 ), DispatchSeg(
Box Plot Seg( 1 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 2 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 3 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 4 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 5 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 6 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 7 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 8 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 9 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 10 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 11 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 12 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 13 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 14 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 15 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 16 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 17 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 18 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 19 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
)}
),
Dispatch( {}, "Means and Std Deviations", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Means Comparisons", OutlineBox, {Close( 1 )} )
)
)));
Re: bucle la función de capacidad de proceso¿Cómo es el código que está llamando la expresión CPK?Re: bucle la función de capacidad de procesogracias por su paciencia, pero incluso después de cambiar a n elementos, también hizo las especificaciones y el histograma en uno de los elementos en las opciones
El otro JMP todavía me solicitó para la clave manual en
CPK = Expr(
For( i = 1,i<=n items(choices) , i++,
Eval(
Substitute(
Expr(
Process Capability(
Process Variables( as column(choices[i])),
Spec Limits( __choices__( LSL( 400 ), Target( 425 ), USL( 450 ) ) ),
Individual Detail Reports( 1 ),
Capability Box Plots( 0 ),
Goal Plot( 0 ),
Capability Index Plot( 0 ),
{ __choices__ << Process Capability Analysis( Histogram( 0 ) )},
Where( :Config == "P1_31_PBO" )
)
),
Expr( __choices__ ), Parse( ":" || choices[i] )
)
)
)
);Re: bucle la función de capacidad de procesoCambié la definición del bucle For () cuando estaba probando el código, y olvidé volver a cambiarlo ... probablemente este sea el problema ... reemplace el bucle For () por
CPK=expr(for(i=1,i<=n items(choices),i++,
Re: bucle la función de capacidad de procesotuiteó un poco
pero las especificaciones y el histograma oculto solo funcionan en el segundo elemento de la lista, ¿sabes?
CPK = Expr(
For( i = 1, i <= 2, i++,
Eval(
Substitute(
Expr(
Process Capability(
Process Variables( as column(choices[i])),
Spec Limits( __choices__( LSL( 400 ), Target( 425 ), USL( 450 ) ) ),
Individual Detail Reports( 1 ),
Capability Box Plots( 0 ),
Goal Plot( 0 ),
Capability Index Plot( 0 ),
{ __choices__ << Process Capability Analysis( Histogram( 0 ) )},
Where( :Config == "P1_31_PBO" )
)
),
Expr( __choices__ ), Parse( ":" || choices[i] )
)
)
)
);Re: bucle la función de capacidad de procesoAlgunas declaraciones en JSL no tienen la capacidad de evaluar elementos en las declaraciones antes de ejecutarlas. Cuando se descubre que ese es el caso, usar una Sustitución para crear la declaración completa antes de ejecutarlo funciona mejor. A continuación se muestra una modificación de su script a la metodología de sustitución.
CPK = Expr(
For( i = 1, i <= 1, i++,
Eval(
Substitute(
Expr(
Process Capability(
Process Variables( __choices__ ),
Spec Limits( __choices__( LSL( 400 ), Target( 425 ), USL( 450 ) ) ),
Individual Detail Reports( 1 ),
Capability Box Plots( 0 ),
Goal Plot( 0 ),
Capability Index Plot( 0 ),
{ __choices__ << Process Capability Analysis( Histogram( 0 ) )},
Where( :Config == "P1_31_PBO" )
)
),
Expr( __choices__ ), Parse( ":" || choices[i] )
)
)
)
);Re: bucle la función de capacidad de procesoGracias por la rápida respuesta,
k no esta vinculado a i
k es como el número de elemento de un grupo e i es el grupo
Las columnas as trabajaron para la variable de proceso pero para los límites de especificación y el cierre del histograma no parece funcionar
/*****************************************************
*********************** Cpk *********************
*****************************************************/
CPK=expr(for(i=1,i<=n items(choices),i++,
Process Capability(
Process Variables(as column(choices[i]) ),
Spec Limits(
as column(choices[i])(LSL( 400 ),
Target( 425 ), USL( 450 ))
),
Individual Detail Reports( 1 ),
Capability Box Plots( 0 ),
Goal Plot( 0 ),
Capability Index Plot( 0 ),
{as column(choices[i]) <<
Process Capability Analysis( Histogram( 0 ) )},
Where( :Config == "P1_31_PBO" )
);
));
Re: bucle la función de capacidad de procesoCreo que su único problema de sintaxis es que necesita una función As Column () alrededor de col_name [i].
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
dt:sex << set name( "Config" );
dt:height << set property( "spec limits", {LSL( 55 ), USL( 70 ), Show Limits( 0 )} );
dt:weight << set property( "spec limits", {LSL( 80 ), USL( 160 ), Show Limits( 0 )} );
config = {"F", "M"};
col_name = dt << get column names( string, continuous );
cpk = Expr(
For( k = 1, k <= N Items( col_name ), k++,
Process Capability(
Process Variables( As Column( col_name[i] ) ),
Individual Detail Reports( 1 ),
Capability Box Plots( 0 ),
Goal Plot( 0 ),
Capability Index Plot( 0 ),
{choice[i] << Process Capability Analysis( Histogram( 0 ) )},
Where( :Config == config[k] )
)
)
);
For( i = 1, i <= N Items( col_name ), i++,
cpk
);
También estoy un poco confundido sobre tu For Loop () usando "k". ¿Está seguro de que desea recorrer 1 a N elementos (col_name)? Parece que col_name está siendo vinculado a la variable "i"?