Più aiuto con ModalCiao,
Sto provando a incorporare alcune finestre di visualizzazione in qualche codice, speravo che l'inserimento di un nome di variabile, da una tabella di dati, nella casella di visualizzazione fosse compilato nelle aree ombreggiate nella sintassi di seguito, ho provato a utilizzare (var_name ["nomeVar "] nelle aree evidenziate senza successo, qualcuno ha qualche 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>
Grazie a tutte le risposte
Ri: Più aiuto con ModalCiao,
Il codice che ho incollato questa mattina deve essere modificato per l'istogramma da Variables (Column (As Column (namevar))), a Variables (X (As Column (namevar))), per far funzionare di nuovo l'istogramma. Il codice sottostante è il codice che ha funzionato quando tutte le linee di riferimento sull'istogramma erano corrette, non sono sicuro del motivo per cui il codice cambia leggermente l'istogramma.
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 )}
)
)
);Ri: Più aiuto con ModalCiao txnelson,
Ho allegato la tabella dei dati, è ancora in corso di lavorazione ma la sua grande esperienza per me che lavoro con JMP per la prima volta e conoscere la sintassi, quindi quello che devo fare è avere la possibilità di passare da una variabile all'altra, in questo Caso QA5030 e il log 10 dello stesso e hanno gli stessi prodotti report, non sono sicuro se sto andando su di esso nel modo giusto. alla fine ho bisogno di sopprimere tutti i registri individuali e produrre un registro completo della distribuzione, dell'istogramma e dei grafici di controllo ed essere in grado di produrre un PDF. Di seguito è riportato il codice finora:
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
)
);Ri: Più aiuto con ModalNon penso di poter fare di più a meno che tu non mi fornisca un campione della tua tabella di dati.
Ri: Più aiuto con ModalCiao Txnelson,
e grazie ancora una volta, il codice ha avuto un piccolo inciampo quando sto cercando di eseguirlo, non completa la costruzione dell'istogramma, qualche idea ??
Grazie per il suggerimento con il tasto destro del mouse e "Reformat Script" potrebbe aiutare anche con la mia formattazione.
Spero che i riferimenti funzionino, una volta che tutto è finito ti mostreranno e ti daranno un consiglio.
Grazie ancora
Ri: Più aiuto con Modal1. C'erano troppi ")". Non hai incollato correttamente il codice sia per Graph Builder che per Control Chart Builder. Puoi facilmente selezionare le sottosezioni di codice, come prendere tutto dalla "Eval" davanti a Graph Builder e selezionare tutto il codice tramite ");" alla fine della sezione Eval, quindi fare clic con il tasto destro del mouse sul codice selezionato e selezionare "Reformat Script". Analizzerà il codice e fornirà eventuali errori rilevati. Questo ti avrebbe detto rapidamente che non hai corrispondenza "()";
2. Il codice per eseguire le piattaforme era errato. Ho dovuto modificare alcuni pezzi di sintassi per rendere il codice corretto. A titolo di esempio, hai specificato nel Generatore di grafici di controllo
Variables( Subgroup( :Lot Number ), Y( column( As Column( namevar ) ) ) ),
"Y (colonna (As Column (namevar ..........") è la sintassi corretta per la piattaforma di distribuzione, ma non per la piattaforma di controllo Chart Builder. Non esiste una funzione "Column ()". Quindi il codice doveva essere cambiato in:
Variables( Subgroup( :Lot Number ), Y( As Column( namevar ) ) )
3. Hai diversi riferimenti a elementi come hist_param ["miniAmount"] e "ref_lines [" lesstandDev "]" che non riesco a determinare se analizzeranno correttamente, poiché non ho il codice di fronte alle sezioni di Eval (). Quindi immagino che tu sia da solo per quello.
Ecco una copia del codice modificato. Assicurati di leggere la documentazione sulla funzione Sostituto (), così capisci come funziona,
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
)
);Ri: Più aiuto con ModalCiao txnelson,
Questo ha funzionato, un'altra domanda, usando la tua risposta come modello non dovrebbe funzionare anche il seguente ??
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
) ) ) )
)
);È per un istogramma e una tabella di controllo, ma non riesco a farlo funzionare.
Grazie mille
Ri: Più aiuto con ModalGrazie pmroz, non hai torto, la mia formattazione è orribile e qualcosa su cui ho bisogno di lavorare, non ho usato il pulsante perché volevo evidenziare alcune cose nel codice e usare il pulsante non mi permetteva evidenziare!!!!
Ri: Più aiuto con ModalIl problema principale che si verifica è che un paio di punti in cui si desidera utilizzare la variabile chiamata "nomeVar" devono essere specificati in modo che JMP li analizzi correttamente.
Nel riferimento
distrib = New Window( namevar,
Si tratta solo di un elemento stringa, e JMP gestirà il semplice modulo semplicemente specificando il nome della variabile ...... finché funzionerà il contenuto della variabile nomeVar è una stringa.
Nel riferimento
Column( As Column( namevar ) ),
È necessario indicare a JMP di trattare la variabile nomeVar come riferimento di colonna, che può essere semplicemente eseguita utilizzando la funzione As Column ().
Il tuo ultimo numero è più difficile. JMP non valuterà SendToReport. Presume che questo è solo codice corretto e non eseguirà alcuna valutazione delle variabili. Pertanto, la funzione Sostituzione () può essere utilizzata per eseguire la valutazione e quindi passare il codice a JMP per essere eseguito.
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
)
);
Ecco la sceneggiatura completa
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>
Ri: Più aiuto con ModalCi sei quasi. Prova questo codice. Ho sostituito il tuo file con Big Class perché non avevo il tuo set di dati.
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>
BTW sarebbe utile quando si pubblica il codice se si usa il pulsante . Anche la formattazione non farebbe male!