Ciao a tutti,
Voglio scrivere lo script "By" in una chiamata alla funzione Pareto.Ho notato che i grafici di Pareto tracciati "Da" assomigliano a questo:
Pareto Plot(Cause( :SBIN_NAM ), X( :Insertion ), Where( :lot_id == "4LU31HFN00_E95029" ))
Il "Dove" implementa il campo "Per" dalla finestra di dialogo della funzione Pareto.
Quindi, ho uno script JMP in cui voglio tracciare i grafici di Pareto in base a una colonna chiamata "lot_id".Tuttavia, voglio che lo script sia generale, quindi non so quali saranno i "lot_id" in anticipo.Quindi, quali valori vengono passati in "Dove" è determinato in fase di esecuzione da qualunque lot_id esista effettivamente nella tabella dei dati.
All'inizio, ho creato un elenco di tutti i lot_id chiamato "listOfLotIDs" nella tabella dei dati e ho provato l'approccio del buon senso.Questo non ha funzionato:
For( i = 1, i <= N Items( listOfLotIDs ), i++,
Pareto Plot( Cause( :SBIN_NAM ), X( :Insertion ), Per Unit Rates( 1 ), Show cumulative Percent Curve( 0 ), Where(:lot_id == listOfLotIDs[i] ));
);
Dopo un po' di tempo sono arrivato a credere che il mio codice non funzionasse perché, per qualche motivo per me perso, il valore passato alla funzione "Dove" deve essere definito tra parentesi con virgolette reali - non puoi semplicemente passargli una variabile stringa.Quindi, ho provato un'altra variante:
For( i = 1, i <= N Items( listOfLotIDs ), i++,
sEval = "Pareto Plot( Cause( :SBIN_NAM ), X( :Insertion ), Per Unit Rates( 1 ), Show cumulative Percent Curve( 0 ), Where(:lot_id == \!"" || listOfLotIDs[i] || "\!"))";
eval(Parse(sEval));
print("PRINT OUTPUT: " || sEval);
);
Credo che la funzione "parse" compili uno script JMP e la funzione "eval" esegua un pezzo di script JMP compilato? Tuttavia, ANCHE questo non funziona.Ho incluso print() della stringa solo per assicurarmi di assemblare correttamente la stringa.Questo è quello che dice il registro:
Error for Pareto Plot on data table 'Subset of 4LU31HFN00_E95029,4LU31HFO00_E93847,4LU31HFP00_E93 20 Where(lot_id == -4LU31HFN00_E95029-)' : One or more columns have missing values on all rows.
"PRINT OUTPUT: Pareto Plot( Cause( :SBIN_NAM ), X( :Insertion ), Per Unit Rates( 1 ), Show cumulative Percent Curve( 0 ), Where(:lot_id == \!"4LU31HFN00_E95029\!"))"
Error for Pareto Plot on data table 'Subset of 4LU31HFN00_E95029,4LU31HFO00_E93847,4LU31HFP00_E93 20 Where(lot_id == -4LU31HFO00_E93847-)' : One or more columns have missing values on all rows.
"PRINT OUTPUT: Pareto Plot( Cause( :SBIN_NAM ), X( :Insertion ), Per Unit Rates( 1 ), Show cumulative Percent Curve( 0 ), Where(:lot_id == \!"4LU31HFO00_E93847\!"))"
Error for Pareto Plot on data table 'Subset of 4LU31HFN00_E95029,4LU31HFO00_E93847,4LU31HFP00_E93 20 Where(lot_id == -4LU31HFP00_E93981-)' : One or more columns have missing values on all rows.
"PRINT OUTPUT: Pareto Plot( Cause( :SBIN_NAM ), X( :Insertion ), Per Unit Rates( 1 ), Show cumulative Percent Curve( 0 ), Where(:lot_id == \!"4LU31HFP00_E93981\!"))"
Error for Pareto Plot on data table 'Subset of 4LU31HFN00_E95029,4LU31HFO00_E93847,4LU31HFP00_E93 20 Where(lot_id == -4LU31HFQ00_E95030-)' : One or more columns have missing values on all rows.
"PRINT OUTPUT: Pareto Plot( Cause( :SBIN_NAM ), X( :Insertion ), Per Unit Rates( 1 ), Show cumulative Percent Curve( 0 ), Where(:lot_id == \!"4LU31HFQ00_E95030\!"))"
Error for Pareto Plot on data table 'Subset of 4LU31HFN00_E95029,4LU31HFO00_E93847,4LU31HFP00_E93 20 Where(lot_id == -4LU31HFR00_E94699-)' : One or more columns have missing values on all rows.
"PRINT OUTPUT: Pareto Plot( Cause( :SBIN_NAM ), X( :Insertion ), Per Unit Rates( 1 ), Show cumulative Percent Curve( 0 ), Where(:lot_id == \!"4LU31HFR00_E94699\!"))"
Quindi cosa diavolo c'è che non va?Come sono state trasformate le mie virgolette (\!") in trattini "-"?!Per favore aiuto.
A proposito, il forum afferma di aver rimosso "HTML non valido" dal corpo del mio messaggio, ma attenzione, alcuni codici o messaggi di errore potrebbero essere confusi.
Ciao,
In base al messaggio di errore, il problema potrebbe essere correlato alla struttura del valore mancante nella tabella dati e non all'istruzione Where. Sarebbe possibile condividere i tuoi dati o una versione fittizia dei tuoi dati?
Migliore,
TS