Offset dei dati del sito 1Ciao,
Ho uno script jmp che compensa i risultati del test in base ai valori della tabella dei dati di riferimento.
Lo farà:
1. Leggere la tabella dei dati e la tabella dei dati di riferimento
2. Genera una nuova finestra per selezionare il numero del sito,
3. In base all'input dell'utente (sito numero 1 o 2), allineare quei dati ai valori della tabella dei dati di riferimento
Prendi la media per ID wafer, applica l'offset alla tabella dati principale
Ecco lo script: non produce l'output previsto
Names Default To Here( 1 );
dt1 = Data Table( "Reference data table" );
dt2 = Current Data Table();
For( i = 1, i <= N Rows( dt1 ), i++,
theTest = dt1:Tests[i];
Try( Column( dt2, theTest ) << set property( "TheMean", dt1:mean[i] ) );
);
New window( "", modal,
ct = checkbox({"1","2"}),
Buttonbox ("Ok",
get = ct << Get Selected ();
)
);
sitenum = Transform Each({str}, get, Num(str));
Col_List1 = dt2 << Get Column Names( "String" );
For( c = 1, c <= N Col( dt2 ) - 1, c++,
theMatrix = [];
name = Column( Col_List1[c] ) << Get name;
If( Contains( Col_List1[c], "IL" ),
mean = .;
Try( mean = Column( dt2, col_list1[c] ) << get property( "theMean" ) );
// Don't process if a value for theMean does not exist
If( Is Missing( mean ) == 0,
For Each Row(
If( Contains(sitenum, dt2:SiteNumber), // Something needs to be changed here *****
r = Row();
//mean = dt1:Mean[dt1 << Get Rows Where( :Tests == name )];
//measure = mean - Col Mean( If( dt2:Strips == dt2:Strips[r], Column( dt2, c ), . ) );
measure = mean - Col Mean( As Column( dt2, c ), :Wafer ID );
theMatrix = theMatrix || Column( dt2, c )[r] + measure;
);
);
Column( dt2, c ) << Set Values( theMatrix );
);
);
);SceneggiaturaRe: Offset dati sito 1Il modo in cui lo gestirei sarebbe inserire le istruzioni show nel codice per determinare a che punto non riesco a ottenere risultati corretti.Ad esempio, dopo aver trasformato ciascuno, inserisci show(sitenum).In questo modo puoi seguire la progressione della logica e vedere dove fallisce.In alternativa è possibile utilizzare lo strumento debugger per eseguire la stessa attività.
Re: Offset dati sito 1@txnelson apprezza se puoi consigliare
Re: Offset dati sito 1Names Default To Here( 1 );
dt1 = Data Table( "Reference data table" );
dt2 = Current Data Table();
For( i = 1, i <= N Rows( dt1 ), i++,
theTest = dt1:Tests[i];
Try( Column( dt2, theTest ) << set property( "TheMean", dt1:mean[i] ) );
);
New Window( "",
modal,
ct = Check Box( {"1", "2"} ),
Button Box( "Ok", get = ct << Get Selected() )
);
sitenum = Transform Each( {str}, get, Num( str ) );
Col_List1 = dt2 << Get Column Names( "String" );
For( c = 1, c <= N Col( dt2 ) - 1, c++,
theMatrix = [];
name = Column( Col_List1[c] ) << Get name;
// The following code is never executed since none of the column names
// have the value "IL" in their name
If( Contains( Col_List1[c], "IL" ),
mean = .;
Try( mean = Column( dt2, col_list1[c] ) << get property( "theMean" ) );
// Don't process if a value for theMean does not exist
If( Is Missing( mean ) == 0,
For Each Row(
If( Contains( sitenum, dt2:SiteNumber ), // Something needs to be changed here *****
r = Row();
//mean = dt1:Mean[dt1 << Get Rows Where( :Tests == name )];
//measure = mean - Col Mean( If( dt2:Strips == dt2:Strips[r], Column( dt2, c ), . ) );
measure = mean - Col Mean( As Column( dt2, c ), :Wafer ID );
theMatrix = theMatrix || Column( dt2, c )[r] + measure;
)
);
Column( dt2, c ) << Set Values( theMatrix );
);
);
);Re: Offset dati sito 1@txnelson Scusate. C'era un errore di battitura nel codice.
Ecco l'affermazione corretta:
// The following code is never executed since none of the column names
// have the value "IL" in their name
If( Contains( Col_List1[c], "Current" ),
Re: Offset dati sito 1È necessario scorrere il codice utilizzando la funzione Show() per vedere quali valori vengono impostati e quindi determinare dove la logica sta andando storta, oppure utilizzare JMP Debugger per eseguire l'analisi.
Questo è il metodo che io o chiunque altro nel forum dovremmo fare.E hai il vantaggio di capire quale ti aspetti che sia l'output.
Re: Offset dati sito 1Potresti anche usare il debugger JMP per esaminare o guardare le variabili utilizzando punti di interruzione o scorrere il codice.
Re: Offset dati sito 1Dovresti davvero imparare a porre domande migliori... e imparare a eseguire il debug degli script. Detto questo, ecco uno script funzionante che fa ciò di cui hai bisogno:
Names Default To Here( 1 );
dt1 = Data Table( "Reference data table" );
dt2 = Current Data Table();
For( i = 1, i <= N Rows( dt1 ), i++,
theTest = dt1:Tests[i];
Try( Column( dt2, theTest ) << set property( "TheMean", dt1:mean[i] ) );
);
New Window( "",
modal,
ct = Check Box( {"1", "2"} ),
Button Box( "Ok", get = ct << Get Selected() )
);
sitenum = Transform Each( {str}, get, Num( str ) );
Col_List1 = dt2 << Get Column Names( "String" );
For( c = 1, c <= N Col( dt2 ) - 1, c++,
If( Contains( Col_List1[c], "Current" ),
mean = .;
Try( mean = Column( dt2, col_list1[c] ) << get property( "theMean" ) );
// Don't process if a value for theMean does not exist
If( !Is Missing( mean ),
For(k=1, k<= n items(sitenum), k++,
rows = dt2 << Select Where( :SiteNumber == sitenum[k] ) << Get Selected Rows;
dt2 << Clear Select();
NewValues = Column( dt2, c )[rows]+mean;
For(i=1, i<= n items(NewValues), i++,
Column( dt2, c )[rows[i]] = NewValues[i]
);
);
);
);
);