여러분 안녕하세요,
Pareto 함수 호출에서 "By"를 스크립팅하고 싶습니다.다음과 같이 "By"로 표시된 Pareto 플롯이 있음을 알 수 있습니다.
Pareto Plot(Cause( :SBIN_NAM ), X( :Insertion ), Where( :lot_id == "4LU31HFN00_E95029" ))
"Where"는 Pareto 함수 대화 상자의 "By" 필드를 구현합니다.
따라서 "lot_id"라는 열로 Pareto 플롯을 플롯하려는 JMP 스크립트가 있습니다.그러나 스크립트가 일반적이기를 원하므로 미리 "lot_id"가 무엇인지 알 수 없습니다.따라서 "Where"로 전달되는 값은 데이터 테이블에 실제로 존재하는 lot_id에 따라 런타임에 결정됩니다.
처음에는 데이터 테이블에 "listOfLotIDs"라는 모든 lot_id의 목록을 만들고 상식적인 접근 방식을 시도했습니다.이것은 작동하지 않았습니다:
For( i = 1, i <= N Items( listOfLotIDs ), i++,
Pareto Plot( Cause( :SBIN_NAM ), X( :Insertion ), Per Unit Rates( 1 ), Show Cum Percent Curve( 0 ), Where(:lot_id == listOfLotIDs[i] ));
);
얼마 후 나는 내 코드가 작동하지 않는다고 믿게 되었습니다. 어떤 이유로 인해 "Where" 함수에 전달된 값이 괄호 안에 실제 따옴표 - 그냥 문자열 변수로 전달할 수는 없습니다.그래서 다른 변형을 시도했습니다.
For( i = 1, i <= N Items( listOfLotIDs ), i++,
sEval = "Pareto Plot( Cause( :SBIN_NAM ), X( :Insertion ), Per Unit Rates( 1 ), Show Cum Percent Curve( 0 ), Where(:lot_id == \!"" || listOfLotIDs[i] || "\!"))";
eval(Parse(sEval));
print("PRINT OUTPUT: " || sEval);
);
"구문 분석" 기능이 JMP 스크립트를 컴파일하고 "eval" 기능이 컴파일된 JMP 스크립트를 실행한다고 생각합니까? 그러나이 ALSO는 작동하지 않습니다.문자열을 올바르게 어셈블했는지 확인하기 위해 문자열의 print()를 포함했습니다.이것은 로그가 말하는 것입니다 :
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 Cum 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 Cum 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 Cum 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 Cum 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 Cum Percent Curve( 0 ), Where(:lot_id == \!"4LU31HFR00_E94699\!"))"
그래서 세상에서 무엇이 잘못 되었습니까?이스케이프된 따옴표(\!")가 어떻게 대시 "-"로 바뀌었나요?!도와주세요.