Más ayuda con ModalHola,
Estoy tratando de incorporar algunos cuadros de visualización en algún código, esperaba que al ingresar el nombre de una variable, desde una tabla de datos, en el cuadro de visualización, se rellenara en las áreas sombreadas de la siguiente sintaxis, he intentado usar (var_name ["nameVar "] en las áreas resaltadas en vano, ¿alguien tiene alguna idea?
Names Default To Here( 1 );
Clear Symbols();
pb = Page Break Box();
fileopen = "\\Kate\TIV\JMP Data.jmp";
var_name = New Window( "Variable Analysis",
<<MODAL></MODAL>
Gracias a todas las respuestas
Re: Más ayuda con ModalHola,
El código que pegué esta mañana debe ser modificado para el histograma de Variables (Columna (Como Columna (namevar))), a Variables (X (Como Columna (namevar))), para que el histograma vuelva a funcionar. El siguiente código es el código que funcionó cuando todas las líneas de referencia en el histograma estaban en su lugar, sin saber por qué cambiar el código alteró ligeramente el histograma.
Names Default To Here ( 1 );
Clear Symbols ();
pb = Page Break Box();
fileopen= "\\cslg1.cslg.net\home\U0053680\home\desktop\Kate\TIV\JMP Data.jmp";
var_name = New Window ("Variable Analysis", << Modal, << Return Result,
Text Box ("Please enter Variable to analyse"),//Create the display box
HListBox(
LineupBox (NCol (2),
Text Box ("Enter Variable Name"), nameVar = textEditBox("QA5030 Thiomersal FBV TIV (%w/v)"),
), // end of lineupbox
LineupBox ( NCol (1), ButtonBox ("OK"), ButtonBox ("Cancel"))
) // end HlistBox
);
show (var_name, var_name ["nameVar"] );
If (var_name ["Button"] == -1,
Caption (" Wait...Aborting..."); Wait (3) ; Caption(Remove); Throw());
StatusMsg ("Processing next steps");
RemoveFrom (var_name, NItems(var_name)); // Removes the last item "Button 1" from the assignment list
Eval List(var_name); // the assignment from the display box are run
Show ( var_name, nameVar );
hist_param = New Window ("Histogram Bin Parameters", << Modal, << Return Result,
Text Box ("Select Histogram Bin Parameters"),//Create the display box
HListBox(
LineupBox (NCol (2),
Text Box ("Minimum Amount"), miniAmount = numberEditBox(0.0078),
Text Box ("Maximum Amount"), maxAmount = numberEditBox(0.0122),
Text Box ("Bins Increase by"), increaseAmount = numberEditBox(0.0002),
), // end of lineupbox
LineupBox ( NCol (1), ButtonBox ("OK"), ButtonBox ("Cancel"))
) // end HlistBox
);
show (hist_param, hist_param ["miniAmount"], hist_param ["maxAmount"], hist_param ["increaseAmount"],
hist_param ["Button"] );
If (hist_param ["Button"] == -1,
Caption (" Wait...Aborting..."); Wait (3) ; Caption(Remove); Throw());
StatusMsg ("Processing next steps");
RemoveFrom (hist_param, NItems(hist_param)); // Removes the last item "Button 1" from the assignment list
Eval List(hist_param); // the assignment from the display box are run
Show ( hist_param, miniAmount, maxAmount, increaseAmount );
ref_lines = New Window ("Reference Lines on Histogram", << Modal, << Return Result,
Text Box ("Select where to place Histogram Reference Lines"),//Create the display box
HListBox(
LineupBox (NCol (2),
Text Box ("LSL"), lowerLimit = numberEditBox(0.008),
Text Box ("USL"), UpperLimit = numberEditBox(0.0120),
Text Box ("-3 Standard Deviations"), lesstandDev = numberEditBox(0.008459),
Text Box ("+3 Standard Devaitions"), maxstandDev = numberEditBox(0.010926),
Text Box ("Mean"), meanAmount = numberEditBox(0.0097375),
), // end of lineupbox
LineupBox ( NCol (1), ButtonBox ("OK"), ButtonBox ("Cancel"))
) // end HlistBox
);
show (ref_lines, ref_lines ["lowerLimit"], ref_lines["UpperLimit"], ref_lines ["lesstandDev"], ref_lines ["maxstandDev"], ref_lines ["meanAmount"],
ref_lines ["Button"] );
If (ref_lines ["Button"] == -1,
Caption (" Wait...Aborting..."); Wait (3) ; Caption(Remove); Throw());
StatusMsg ("Processing next steps");
RemoveFrom (ref_lines, NItems(ref_lines)); // Removes the last item "Button 1" from the assignment list
Eval List(ref_lines); // the assignment from the display box are run
Show ( ref_lines, lowerLimit, UpperLimit, lesstandDev, maxstandDev, meanAmount);
Eval(
Substitute(
Expr(
distrib = New Window( namevar,
Distribution(
Continuous Distribution(
Column( As Column( namevar ) ),
Normal Quantile Plot( 1 ),
Fit Distribution( Normal( Goodness of Fit( 1 ) ) )
),
SendToReport( Dispatch( {__myvar__}, "", Picture Box( 5 ), {Set Summary Behavior( "Collapse" )} ) )
)
) << Move Window( 634, 43 ) << Size Window( 807, 861 ) << Set Window Icon( "Distrib" )
),
Expr( __myvar__ ), namevar
)
);
Graph Builder(
Variables( X( :Name( "QA5030 Thiomersal FBV TIV (%w/v)" ) ) ),
Elements( Histogram( X, Legend( 2 ) ), Histogram( X, Legend( 3 ) ) ),
Local Data Filter,
SendToReport(
Dispatch( {}, "Histogram", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Histogram", Outline Box( 2 ), {Close( 1 )} ),
Dispatch(
{},
"QA5030 Thiomersal FBV TIV (%w",
ScaleBox,
{Min( hist_param ["miniAmount"] ), Max(hist_param ["maxAmount"] ), Inc(hist_param ["increaseAmount"] ), Minor Ticks( 0 ),
Add Ref Line( ref_lines ["lowerLimit"], "Solid", "Blue", "LSL", 1 ),
Add Ref Line( ref_lines["UpperLimit"], "Solid", "Blue", "USL", 1 ),
Add Ref Line( ref_lines ["lesstandDev"], "Solid", "Red", "-3SP", 1 ),
Add Ref Line(ref_lines ["maxstandDev"], "Solid", "Red", "+3SP", 1 ),
Add Ref Line( ref_lines ["meanAmount"], "Solid", "Green", "Mean", 1 )}
)
)
);
Control Chart Builder(
Size( 1187, 500 ),
Show Capability( 0 ),
Variables(
Subgroup( :Lot Number ),
Y( :Name( "QA5030 Thiomersal FBV TIV (%w/v)" ) )
),
Chart( Position( 1 ), Limits( Sigma( Moving Range ) ) ),
Chart( Position( 2 ), Limits( Sigma( Moving Range ) ) ),
SendToReport(
Dispatch(
{},
"QA5030 Thiomersal FBV TIV (%w",
ScaleBox,
{Min( 0.00779755917159763 ), Max( 0.0125370562130178 ), Inc( 0.0005 ),
Minor Ticks( 0 ), Add Ref Line(
0.012,
"Solid",
"Blue",
"USL (0.012)",
1
), Add Ref Line( 0.008, "Solid", "Blue", "LSL (0.008)", 1 )}
)
)
);Re: Más ayuda con ModalHola txnelson
He adjuntado la tabla de datos, aún es un trabajo en progreso, pero es una gran experiencia para mí trabajar con JMP por primera vez y conocer la sintaxis, así que lo que debo hacer es tener la capacidad de cambiar entre variables, en este el caso QA5030 y el registro 10 de los mismos y tienen los mismos productos de informes, no estoy seguro de si lo estoy haciendo de la manera correcta. al final, necesito suprimir todos los registros individuales y generar un registro completo de la distribución, el histograma y los gráficos de control y poder producir un PDF. A continuación se muestra el código hasta el momento:
Names Default To Here ( 1 );
Clear Symbols ();
pb = Page Break Box();
fileopen= "\\cslg1.cslg.net\home\U0053680\home\desktop\Kate\TIV\JMP Data.jmp";
var_name = New Window ("Variable Analysis", << Modal, << Return Result,
Text Box ("Please enter Variable to analyse"),//Create the display box
HListBox(
LineupBox (NCol (2),
Text Box ("Enter Variable Name"), nameVar = textEditBox("QA5030 Thiomersal FBV TIV (%w/v)"),
), // end of lineupbox
LineupBox ( NCol (1), ButtonBox ("OK"), ButtonBox ("Cancel"))
) // end HlistBox
);
show (var_name, var_name ["nameVar"] );
If (var_name ["Button"] == -1,
Caption (" Wait...Aborting..."); Wait (3) ; Caption(Remove); Throw());
StatusMsg ("Processing next steps");
RemoveFrom (var_name, NItems(var_name)); // Removes the last item "Button 1" from the assignment list
Eval List(var_name); // the assignment from the display box are run
Show ( var_name, nameVar );
hist_param = New Window ("Histogram Bin Parameters", << Modal, << Return Result,
Text Box ("Select Histogram Bin Parameters"),//Create the display box
HListBox(
LineupBox (NCol (2),
Text Box ("Minimum Amount"), miniAmount = numberEditBox(0.00728),
Text Box ("Maximum Amount"), maxAmount = numberEditBox(0.0122),
Text Box ("Bins Increase by"), increaseAmount = numberEditBox(0.0002),
), // end of lineupbox
LineupBox ( NCol (1), ButtonBox ("OK"), ButtonBox ("Cancel"))
) // end HlistBox
);
show (hist_param, hist_param ["miniAmount"], hist_param ["maxAmount"], hist_param ["increaseAmount"],
hist_param ["Button"] );
If (hist_param ["Button"] == -1,
Caption (" Wait...Aborting..."); Wait (3) ; Caption(Remove); Throw());
StatusMsg ("Processing next steps");
RemoveFrom (hist_param, NItems(hist_param)); // Removes the last item "Button 1" from the assignment list
Eval List(hist_param); // the assignment from the display box are run
Show ( hist_param, miniAmount, maxAmount, increaseAmount );
ref_lines = New Window ("Reference Lines on Histogram", << Modal, << Return Result,
Text Box ("Select where to place Histogram Reference Lines"),//Create the display box
HListBox(
LineupBox (NCol (2),
Text Box ("LSL"), lowerLimit = numberEditBox(0.008),
Text Box ("USL"), UpperLimit = numberEditBox(0.0120),
Text Box ("-3 Standard Deviations"), lesstandDev = numberEditBox(0.008459),
Text Box ("+3 Standard Devaitions"), maxstandDev = numberEditBox(0.010926),
Text Box ("Mean"), meanAmount = numberEditBox(0.009375),
), // end of lineupbox
LineupBox ( NCol (1), ButtonBox ("OK"), ButtonBox ("Cancel"))
) // end HlistBox
);
show (ref_lines, ref_lines ["lowerLimit"], ref_lines["UpperLimit"], ref_lines ["lesstandDev"], ref_lines ["maxstandDev"], ref_lines ["meanAmount"],
ref_lines ["Button"] );
If (ref_lines ["Button"] == -1,
Caption (" Wait...Aborting..."); Wait (3) ; Caption(Remove); Throw());
StatusMsg ("Processing next steps");
RemoveFrom (ref_lines, NItems(ref_lines)); // Removes the last item "Button 1" from the assignment list
Eval List(ref_lines); // the assignment from the display box are run
Show ( ref_lines, lowerLimit, UpperLimit, lesstandDev, maxstandDev, meanAmount);
Eval(
Substitute(
Expr(
distrib = New Window( namevar,
Distribution(
Continuous Distribution(
Column( As Column( namevar ) ),
Normal Quantile Plot( 1 ),
Fit Distribution( Normal( Goodness of Fit( 1 ) ) )
),
SendToReport( Dispatch( {__myvar__}, "", Picture Box( 5 ), {Set Summary Behavior( "Collapse" )} ) )
)
) << Move Window( 634, 43 ) << Size Window( 807, 861 ) << Set Window Icon( "Distrib" )
),
Expr( __myvar__ ), namevar
)
);
Eval(
Substitute(
Expr(
Graph Builder(
Variables( Column( As Column( namevar ) ) ),
Elements( Histogram( X, Legend( 2 ) ), Histogram( X, Legend( 3 ) ) ),
Local Data Filter,
SendToReport(
Dispatch( {}, "Histogram", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Histogram", Outline Box( 2 ), {Close( 1 )} ),
Dispatch(
{__myvar__},
" ",
ScaleBox,
{Min( hist_param["miniAmount"] ), Max( hist_param["maxAmount"] ), Inc( hist_param["increaseAmount"] ), Minor Ticks( 0 ),
Add Ref Line( ref_lines["lowerLimit"], "Solid", "Blue", "LSL", 1 ), Add Ref Line(
ref_lines["UpperLimit"],
"Solid",
"Blue",
"USL",
1
), Add Ref Line( ref_lines["lesstandDev"], "Solid", "Red", "-3SP", 1 ), Add Ref Line(
ref_lines["maxstandDev"],
"Solid",
"Red",
"+3SP",
1
), Add Ref Line( ref_lines["meanAmount"], "Solid", "Green", "Mean", 1 )}
)
)
)
),
Expr( __myvar__ ), namevar
)
);
Eval(
Substitute(
Expr(
Control Chart Builder(
Size( 1187, 500 ),
Show Capability( 0 ),
Variables( Subgroup( :Lot Number ), Y( As Column( namevar ) ) ),
Chart( Position( 1 ), Limits( Sigma( Moving Range ) ) ),
Chart( Position( 2 ), Limits( Sigma( Moving Range ) ) ),
SendToReport(
Dispatch(
{},
__myvar__,
ScaleBox,
{Min( 0.00779755917159763 ), Max( 0.0125370562130178 ), Inc( 0.0005 ), Minor Ticks( 0 ),
Add Ref Line( 0.012, "Solid", "Blue", "USL (0.012)", 1 ), Add Ref Line( 0.008, "Solid", "Blue", "LSL (0.008)", 1 )}
)
)
)
),
Expr( __myvar__ ), namevar
)
);Re: Más ayuda con ModalNo creo que pueda hacer más a menos que me proporcione una muestra de su tabla de datos.
Re: Más ayuda con ModalHola Txnelson,
y gracias una vez más, el código ha tenido un pequeño tropiezo cuando intento ejecutarlo, no se completa la construcción del histograma, ¿alguna idea?
Gracias por la sugerencia al hacer clic con el botón derecho y "Reformat Script" también podría ayudar con mi formato.
Espero que las referencias funcionen, una vez que esté todo terminado, se le mostrará y obtendrá algunos consejos.
Gracias de nuevo
Re: Más ayuda con Modal1. Había demasiados ")". No pegó correctamente el código para el Generador de gráficos y el Generador de gráficos de control. Puede seleccionar fácilmente las subsecciones de código, como tomar todo lo que está en "Eval" frente al Generador de gráficos, y seleccionar todo el código a través de ")". al final de la sección Eval, haga clic con el botón derecho en el código seleccionado y seleccione "Reformat Script. Analizará el código y le dará cualquier error que encuentre. Eso te habría dicho rápidamente que no tienes una coincidencia con "()";
2. El código para ejecutar las plataformas era incorrecto. Tuve que cambiar algunas piezas diferentes de sintaxis para corregir el código. Como una ilustración, había especificado en el Control Chart Builder.
Variables( Subgroup( :Lot Number ), Y( column( As Column( namevar ) ) ) ),
La "Y (columna (Como columna (namevar ..........") tiene la sintaxis correcta para la Plataforma de distribución, pero no para la Plataforma del generador de gráficos de control. No hay una función de "Columna ()". Así que el código necesitaba ser cambiado a:
Variables( Subgroup( :Lot Number ), Y( As Column( namevar ) ) )
3. Tiene varias referencias a elementos como hist_param ["miniAmount"] y "ref_lines [" lesstandDev "]" que no puedo determinar si se analizarán correctamente, ya que no tengo el código delante de las secciones Eval (). Así que supongo que estás por tu cuenta para eso.
Aquí hay una copia del código modificado. Asegúrese de leer la documentación de la función Substitute () para que pueda comprender cómo funciona.
Eval(
Substitute(
Expr(
Graph Builder(
Variables( Column( As Column( namevar ) ) ),
Elements( Histogram( X, Legend( 2 ) ), Histogram( X, Legend( 3 ) ) ),
Local Data Filter,
SendToReport(
Dispatch( {}, "Histogram", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Histogram", Outline Box( 2 ), {Close( 1 )} ),
Dispatch(
{__myvar__},
" ",
ScaleBox,
{Min( hist_param["miniAmount"] ), Max( hist_param["maxAmount"] ), Inc( hist_param["increaseAmount"] ), Minor Ticks( 0 ),
Add Ref Line( ref_lines["lowerLimit"], "Solid", "Blue", "LSL", 1 ), Add Ref Line(
ref_lines["UpperLimit"],
"Solid",
"Blue",
"USL",
1
), Add Ref Line( ref_lines["lesstandDev"], "Solid", "Red", "-3SP", 1 ), Add Ref Line(
ref_lines["maxstandDev"],
"Solid",
"Red",
"+3SP",
1
), Add Ref Line( ref_lines["meanAmount"], "Solid", "Green", "Mean", 1 )}
)
)
)
),
Expr( __myvar__ ), namevar
)
);
Eval(
Substitute(
Expr(
Control Chart Builder(
Size( 1187, 500 ),
Show Capability( 0 ),
Variables( Subgroup( :Lot Number ), Y( As Column( namevar ) ) ),
Chart( Position( 1 ), Limits( Sigma( Moving Range ) ) ),
Chart( Position( 2 ), Limits( Sigma( Moving Range ) ) ),
SendToReport(
Dispatch(
{},
__myvar__,
ScaleBox,
{Min( 0.00779755917159763 ), Max( 0.0125370562130178 ), Inc( 0.0005 ), Minor Ticks( 0 ),
Add Ref Line( 0.012, "Solid", "Blue", "USL (0.012)", 1 ), Add Ref Line( 0.008, "Solid", "Blue", "LSL (0.008)", 1 )}
)
)
)
),
Expr( __myvar__ ), namevar
)
);Re: Más ayuda con ModalHola txnelson
Esto funcionó muy bien, una pregunta más, usando su respuesta como plantilla, ¿no debería funcionar también lo siguiente?
Eval (
Substitute (
Expr (
Graph Builder(
Variables( Column ( As Column (namevar) ) ) ),
Elements( Histogram( X, Legend( 2 ) ), Histogram( X, Legend( 3 ) ) ),
Local Data Filter,
SendToReport(
Dispatch( {}, "Histogram", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Histogram", Outline Box( 2 ), {Close( 1 )} ),
Dispatch( { __myvar__ }, " ",
ScaleBox,
{Min( hist_param ["miniAmount"] ), Max(hist_param ["maxAmount"] ), Inc(hist_param ["increaseAmount"] ), Minor Ticks( 0 ),
Add Ref Line( ref_lines ["lowerLimit"], "Solid", "Blue", "LSL", 1 ),
Add Ref Line( ref_lines["UpperLimit"], "Solid", "Blue", "USL", 1 ),
Add Ref Line( ref_lines ["lesstandDev"], "Solid", "Red", "-3SP", 1 ),
Add Ref Line(ref_lines ["maxstandDev"], "Solid", "Red", "+3SP", 1 ),
Add Ref Line( ref_lines ["meanAmount"], "Solid", "Green", "Mean", 1 )}
Expr ( __myvar__ ), namevar
) ) )
)
)
);
Eval (
Substitute (
Expr (
Control Chart Builder(
Size( 1187, 500 ),
Show Capability( 0 ),
Variables(
Subgroup( :Lot Number ),
Y( Column ( As Column (namevar) ) )
),
Chart( Position( 1 ), Limits( Sigma( Moving Range ) ) ),
Chart( Position( 2 ), Limits( Sigma( Moving Range ) ) ),
SendToReport(
Dispatch( { __myvar__ }, " ",
ScaleBox,
{Min( 0.00779755917159763 ), Max( 0.0125370562130178 ), Inc( 0.0005 ),
Minor Ticks( 0 ), Add Ref Line(
0.012,
"Solid",
"Blue",
"USL (0.012)",
1
), Add Ref Line( 0.008, "Solid", "Blue", "LSL (0.008)", 1 )}
Expr ( __myvar__ ), namevar
) ) ) )
)
);Es para un histograma y un gráfico de control, pero parece que no puedo hacerlo funcionar.
Montones de gracias
Re: Más ayuda con ModalGracias, pmroz, no se equivoca, mi formato es horrible y algo en lo que necesito trabajar, no usé el botón porque quería resaltar algo en el código y usar el botón no me dejaba ¡¡¡¡realce!!!!
Re: Más ayuda con ModalEl problema principal que está teniendo es que un par de lugares donde desea usar su variable llamada "nameVar" deben especificarse de manera que JMP los analice correctamente.
En la referencia
distrib = New Window( namevar,
Solo está tratando con un elemento de cadena, y JMP manejará la forma simple de especificar el nombre de la variable ...... siempre que el contenido de la variable nameVar sea una cadena, esto funcionará.
En la referencia
Column( As Column( namevar ) ),
Debe decirle a JMP que trate la variable nameVar como una referencia de columna, lo que puede hacerse simplemente usando la función As Column ().
Tu última cuestión es más difícil. JMP no evaluará el SendToReport. Asume que este es solo el código correcto y no realizará ninguna evaluación de variables. Por lo tanto, la función Sustitución () se puede utilizar para realizar la evaluación y luego pasar el código a JMP para su ejecución.
Eval(
Substitute(
Expr(
distrib = New Window( namevar,
Distribution(
Continuous Distribution(
Column( As Column( namevar ) ),
Normal Quantile Plot( 1 ),
Fit Distribution( Normal( Goodness of Fit( 1 ) ) )
),
SendToReport( Dispatch( {__myvar__}, "", Picture Box( 5 ), {Set Summary Behavior( "Collapse" )} ) )
)
) << Move Window( 634, 43 ) << Size Window( 807, 861 ) << Set Window Icon( "Distrib" )
),
Expr( __myvar__ ), namevar
)
);
Aquí está el guión completo
Names Default To Here( 1 );
Clear Symbols();
pb = Page Break Box();
fileopen = "\\Kate\TIV\JMP Data.jmp";
var_name = New Window( "Variable Analysis",
<<MODAL></MODAL>
Re: Más ayuda con ModalYa casi estás ahí. Prueba este código. Reemplacé su archivo con Big Class porque no tenía su conjunto de datos.
Names Default To Here( 1 );
//fileopen = "\\Kate\TIV\JMP Data.jmp";
fileopen = "$sample_data\Big Class.jmp";
dt = open(fileopen);
var_name = New Window( "Variable Analysis", <<MODAL></MODAL>
Por cierto, sería útil al publicar el código si usara el botón . ¡El formateo tampoco haría daño!