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 )}
)
)
););시도해 볼 몇 가지 - 먼저 Open Table() 구조를 New SQL Query()로 변경합니다. 둘째, 루프 대신 "열 속성에 저장" 메시지와 함께 Manage Limits()를 사용해 보십시오. 스크립팅 인덱스에서 두 가지 예를 모두 찾을 수 있습니다. 쿼리 작성기를 사용하여 쿼리 호출을 그래픽으로 생성할 수도 있습니다. 그런 다음 빨간색 삼각형 메뉴 옵션을 사용하여 완성된 스크립트 조각을 저장할 수 있습니다.