열 속성을 JMP 데이터 파일로 가져오려면 어떻게 해야 합니까?안녕,
새로운 도전:
열 속성을 만들었습니다. 테스트 번호 1st_file에서. 각 테스트에는 아래 강조 표시된 빨간색 원에서 볼 수 있듯이 열 속성에서 찾을 수 있는 고유한 테스트 번호가 있습니다.

1개의 열(테스트)이 있는 두 번째 JMP 파일이 있습니다.

첫 번째 파일에서 테스트 번호를 복사하고 두 번째 파일의 테스트 중 가장 낮은 값을 할당하여 내 출력이 상대적으로 다음과 같이 보일 수 있는 스크립트를 작성하려고 합니다.
테스트 번호는 첫 번째 파일의 Column 속성에 정의되어 있습니다.
예 굽기, 냉각, 지속가능발전교육 = 최소[테스트 번호] = 21
산출:

어떤 제안?
감사
Re: 열 속성을 JMP 데이터 파일로 가져오려면 어떻게 해야 합니까?If에 대한 좋은 시도 .....하지만 분기 범위가 더 커야합니다.아래 참조 ......
Names Default To Here( 1 );
dt1 = Data Table( "1st_file" );
dt2 = Data Table( "2nd file" );
dt2 << New Column( "Test Number" );
For( i = 1, i <= N Rows( dt2 ), i++,
k = 1;
While( Word( k, dt2:test[i], "," ) != "",
theWord = Word( k, dt2:test[i], "," );
If( theWord != "N/A",
If( k == 1,
theTest = Column( dt1, theWord ) << get property( "Test Number" ),
theCompare = Column( dt1, theWord ) << get property( "Test Number" );
If( theCompare < theTest,
theTest = theCompare
);
)
,
theTest = 0
);
k++;
);
dt2:test number[i] = theTest;
);Re: 열 속성을 JMP 데이터 파일로 가져오려면 어떻게 해야 합니까?안녕 @txnelson ,
마지막 질문 하나
나는 약간 해당 없음 다음과 같은 행을 테스트하십시오. 할당하고 싶었다 테스트 번호 ~처럼 0 에게 해당 없음 행

나는 추가했다 만약에() 명세서를 입력했지만 명세서를 올바르게 입력했는지 확실하지 않습니다. 좀 봐주시겠어요?
Names Default To Here( 1 );
dt1 = Data Table( "1st_file" );
dt2 = Data Table( "2nd file" );
dt2 << New Column("Test Number");
For( i = 1, i <= N Rows( dt2 ), i++,
k = 1;
While( Word( k, dt2:test[i], "," ) != "",
theWord = Word( k, dt2:test[i], "," );
If( k == 1,
theTest = Column( dt1, theWord ) << get property( "Test Number" ),
theCompare = Column( dt1, theWord ) << get property( "Test Number" );
If( theCompare < theTest,
theTest = theCompare
);
);
k++;
<STRONG>If( Word( 1, dt2:test[i], "," ) == N/A,
dt2:test number[i] = 0;
);</STRONG><BR /> );
dt2:test number[i] = theTest;
);
Re: 열 속성을 JMP 데이터 파일로 가져오려면 어떻게 해야 합니까?Names Default To Here( 1 );
dt1 = Data Table( "1st_file" );
dt2 = Data Table( "2nd file" );
For( i = 1, i <= N Rows( dt2 ), i++,
k = 1;
While( Word( k, dt2:test[i], "," ) != "",
theWord = Word( k, dt2:test[i], "," );
If( k == 1,
theTest = Column( dt1, theWord ) << get property( "Test Number" ),
theCompare = Column( dt1, theWord ) << get property( "Test Number" );
If( theCompare < theTest,
theTest = theCompare
);
);
k++;
);
dt2:test number[i] = theTest;
);Re: 열 속성을 JMP 데이터 파일로 가져오려면 어떻게 해야 합니까?안녕 @txnelson ,
가능하면 코드를 게시할 수 있습니까? 이 작업을 완료하는 데 기한이 있습니다. 테스트가 3개 미만인 행에 대해 while() 함수를 사용해 보았지만 실행되지 않습니다. 논의가 길어지고 혼란스러워지고 있습니다.
Re: 열 속성을 JMP 데이터 파일로 가져오려면 어떻게 해야 합니까?안녕 @txnelson ,
제안이 있습니다. 목록을 만들고 목록에 테스트 번호를 저장하고 구문을 사용할 수 있습니까? 최소() 가장 낮은 번호를 할당하려면?
For (i=1, i<=2, i++,
theWord = word(i,dt2:test[1],",");
theTest() = column( dt1, theWord ) << get property("Test Number");
dt2:test number[1] = Min(theTest);
);
Re: 열 속성을 JMP 데이터 파일로 가져오려면 어떻게 해야 합니까?이것은 저에게 있습니다 ..... 잘못된 변수로 테스트를하고있었습니다.비교를 수행하는 문장은 읽어야 합니다.
If( theCompare < theTest,
theTest = theCompare
);
그러나 또 다른 문제가 있습니다. 스크립트는 Test 열의 각 행에 항상 3개의 값이 있다고 가정합니다.3보다 적으면 스크립트가 실패하고 3보다 많으면 4,5 등 항목과 절대 비교되지 않습니다.
이 문제를 해결하는 방법에 대해서는 While() 함수를 살펴보십시오.
아래는 비교 문에 대해 수정된 코드입니다.
Names Default To Here( 1 );
dt1 = Data Table( "1st_file" );
dt2 = Data Table( "2nd file" );
For( i = 1, i <= N Rows( dt2 ), i++,
theWord = Word( 1, dt2:test[i], "," );
theTest = Column( dt1, theWord ) << get property( "Test Number" );
theWord = Word( 2, dt2:test[i], "," );
theCompare = Column( dt1, theWord ) << get property( "Test Number" );
If( theCompare < theTest,
theTest = theCompare
);
theWord = Word( 3, dt2:test[i], "," );
theCompare = Column( dt1, theWord ) << get property( "Test Number" );
If( theCompare < theTest,
theTest = theCompare
);
dt2:test number[i] = theTest;
);
Re: 열 속성을 JMP 데이터 파일로 가져오려면 어떻게 해야 합니까?안녕 @txnelson ,
귀하가 제안한 논리는 일부 조건에서 작동하지 않습니다. 테스트 순서를 변경하면 스크립트가 잘못된 값을 생성하고 행 4,5,6에 대한 테스트 번호가 비어 있습니다.
테스트 = 냉각, ESD, 전류
테스트 번호 = 테스트 번호의 최소값[32, 87, 23] = 23
테스트 번호는 두 번째 열에 23이어야 합니다.

나는 당신이 제안한 진술을 수정했습니다.
For (i=1, i<=nrows(dt2), i++,
theWord = word(1,dt2:test[i],",");
theTest = column( dt1, theWord ) << get property("Test Number");
theWord = word(2,dt2:test[i],",");
theCompare = column( dt1, theWord ) << get property("Test Number");
If( theCompare < theWord, theTest = theCompare );
theWord = word(3,dt2:test[i],",");
theCompare = column( dt1, theWord ) << get property("Test Number");
If( theCompare < theWord, theTest = theCompare );
dt2:test number[i] = theTest;
);
Re: 열 속성을 JMP 데이터 파일로 가져오려면 어떻게 해야 합니까?문제는 이 진술에 있다
theWord = word(i,dt2:test[i],",");
For() 루프는 "i"를 인덱스로 사용하고 있으며 1에서 N Rows(dt2)까지 다양합니다.따라서 1에서 5까지 다양합니다. Word() 함수 내에서 2개의 다른 위치에서 "i" 인덱스를 사용하고 있습니다.dt2:Test[i]는 첫 번째 행부터 5행까지를 읽습니다.그러나 JSL 구문 참조를 살펴보면 Word() 함수의 경우
Word(n|[first last], string, <delimiter>, <Unmatched(result string)>)
Description
Returns the nth item of the string, where words are sub-strings separated by any number of
any characters in the delimiter argument.
Arguments
n The position of the word being extracted.
[first last] A matrix that defines the beginning and end word range to return.
string The string that is evaluated.
delimiter (Optional) The character used as a boundary. If delimiter is absent, an ASCII
space is used. If delimiter is the empty string, each character is treated as a separate
word. If delimiter is an empty string, each character is treated as a spate word.
Unmatched(result string) The string to print if no match is found.
Examples
This example returns the last name:
Word( 2, "Katie Layman" );
Note
See “Item(n|[first last], string, <delimiter>, <Unmatched(result string)>, <Include
Boundary Delimiters(Boolean)>)” on page 35 for examples of how Word() differs from
Item().
제거하려는 단어에 대해 지정하는 것은 "i" 값에 따라 다릅니다.그것은 당신이 원하는 것이 아닙니다.내가 제공한 코드에서 보면 1,2 또는 3 중 하나였습니다.
그래서 당신은 그것을 조정해야합니다
Re: 열 속성을 JMP 데이터 파일로 가져오려면 어떻게 해야 합니까?안녕 @txnelson ,
나는 당신이 게시 한 스크립트에서 For 루프를 사용했습니다.
names default to here(1);
dt1 = data table("1st_file");
dt2 = data table("2nd file");
dt2 << New Column("Test Number");
For(i=1, i<=nrows(dt2),i++,
theWord = word(i,dt2:test[i],",");
theTest = column( dt1, theWord ) << get property("Test Number");
theWord = word(i,dt2:test[i],",");
theCompare = column( dt1, theWord ) << get property("Test Number");
If( theCompare < theWord, theTest = theCompare );
theWord = word(i,dt2:test[i],",");
theCompare = column( dt1, theWord ) << get property("Test Number");
If( theCompare < theWord, theTest = theCompare );
dt2:test number[i] = theTest;
);
<BR />두 번째 파일의 4행과 5행에 값을 할당하지 않습니다.

For 루프에서 내가 실수를 했다고 확신합니다. 안내 좀 부탁드려도 될까요?
Re: 열 속성을 JMP 데이터 파일로 가져오려면 어떻게 해야 합니까?@txnelson 당신은 천재입니다. 네 맞습니다. 배우기 시작하겠습니다. 정말 감사합니다Re: 열 속성을 JMP 데이터 파일로 가져오려면 어떻게 해야 합니까?@Jacksmith12 이전 예에서 이러한 모든 명령문과 기능을 살펴보았습니다.그것들을 스스로 조립할 수 있도록 시작해야 합니다.컴퓨팅에서 배우는 유일한 방법은 실수를 하고 문제가 무엇인지 알아내는 것입니다.따라서 아래는 최소 테스트 번호를 반환하는 2nd_file의 단일 항목에 대한 흐름입니다.나머지 코드를 함께 넣을 수 있어야 합니다.
names default to here(1);
dt1 = data table("1st_file ");
dt2 = data table("2nd file ");
dt2 << New Column("Test Number");
theWord = word(1,dt2:test[1],",");
theTest = column( dt1, theWord ) << get property("Test Number");
theWord = word(2,dt2:test[1],",");
theCompare = column( dt1, theWord ) << get property("Test Number");
If( theCompare < theWord, theTest = theCompare );
theWord = word(3,dt2:test[1],",");
theCompare = column( dt1, theWord ) << get property("Test Number");
If( theCompare < theWord, theTest = theCompare );
dt2:test number[1] = theTest;
코드의 각 줄을 이해했는지 확인하고, 이해하지 못한다면 이해하지 못한 부분에 대해 구체적으로 질문하십시오.
Re: 열 속성을 JMP 데이터 파일로 가져오려면 어떻게 해야 합니까?빠른 시작 예를 들어 주시겠습니까?Re: 열 속성을 JMP 데이터 파일로 가져오려면 어떻게 해야 합니까?1st_file에서 열에는 각각 1개의 열 속성만 있고 테스트 번호.....테스트 이름은 없습니다.
Test Name의 각 열에 대한 두 번째 Column Property가 1st_File 데이터 테이블에 있어야 한다고 가정하면 이에 액세스하는 가장 좋은 방법은 Associative Array를 만드는 것입니다. 그런 다음 각 열을 순환하면서 2개의 열 속성을 추출하고 연관 배열에 배치합니다. 마지막으로 행 단위로 2nd_file을 반복하고 Test 열의 값을 취하면 Associative Array에 대한 간단한 조회가 되어 필요한 테스트 번호를 얻을 수 있습니다.Re: 열 속성을 JMP 데이터 파일로 가져오려면 어떻게 해야 합니까?안녕 @txnelson ,
열 속성을 마우스 오른쪽 버튼으로 클릭하면 테스트 번호와 테스트 이름을 찾을 수 있습니다.
Re: 열 속성을 JMP 데이터 파일로 가져오려면 어떻게 해야 합니까?1st_file의 어떤 열이 2nd_file의 특정 행 값을 계산할 때 평가되는지 어떻게 알 수 있습니까?