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.
JMP PRO에서는 잘 작동하고 1)과 2)단계는 JMP LIVE에서도 잘 작동하지만 세 번째 부분을 추가하면 데이터를 새로 고칠 때 재생성에 실패했다는 메시지가 나타납니다.
JMP PRO에서 작동하는 JSL은 다음과 같습니다.
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 )}
)
)
););