Hi,
I wrote a script that 1) queries a table(myDT) to build a control chart on and 2) another table(specLimitsTable) and 3) a loop that takes data from the second table to set spec limits on table 1.
Funziona perfettamente in JMP PRO e i passaggi 1) e 2) funzionano correttamente in JMP LIVE ma quando aggiungo la terza parte viene visualizzato il messaggio Impossibile rigenerarsi quando vado ad aggiornare i dati.
Il JSL che funziona in JMP PRO è riportato di seguito:
myDT = Open Database(
"APP=JMP;DATABASE=BBAnalytics;DRIVER={SQL Server};Description=BB Analytics Data Warehouse;Trusted_Connection=Yes;UID=%_UID_%;WSID=SFX-JPCZ724;SERVER=SFX-DWA01;DBCNAME=SFX-DWA01;",
"SELECT * FROM [dbo].[DDGSControlChartDataBPX]",
"myDT"
);
specLimitsTable = Open Database(
"APP=JMP;DATABASE=BBAnalytics;DRIVER={SQL Server};Description=BB Analytics Data Warehouse;Trusted_Connection=Yes;UID=%_UID_%;WSID=SFX-JPCZ724;SERVER=SFX-DWA01;DBCNAME=SFX-DWA01;",
"SELECT * FROM [dbo].[PivotSpecLimitsMediansBPXF]",
"specDTTest"
);
// Iterate over the rows of the spec limits table
For Each Row(specLimitsTable,
// Get values from the current row
column_name = Column(specLimitsTable, "Column_Name")[Row()];
lsl = Column(specLimitsTable, "LSL")[Row()];
usl = Column(specLimitsTable, "USL")[Row()];
// Set spec limits for the corresponding column in the main data table
col_ref = Column(myDT, column_name);
Eval(
Eval Expr(
col_ref << Set Property(
"Spec Limits",
{LSL( Expr( lsl ) ), USL( Expr( usl ) ),
Show Limits( 1 )}
)
)
););Un paio di cose da provare: innanzitutto modificare la struttura Open Table() in New SQL Query(). In secondo luogo, prova a utilizzare Gestisci limiti() con il messaggio "Salva nelle proprietà della colonna" invece del ciclo. Puoi trovare esempi di entrambi nell'indice degli script. Query Builder può essere utilizzato anche per creare graficamente le chiamate alle query. È quindi possibile utilizzare l'opzione del menu Triangolo rosso per salvare uno snippet di script finito.