열 속성을 기준으로 열 정렬안녕하세요 JMP 커뮤니티,
열 속성으로 열을 정렬하는 방법이 있습니까?
열에 "Test Number" 속성이 포함된 데이터 테이블이 있습니다(아래 참조).
열 속성 "Test Number"를 기준으로 "Tests" 열 그룹의 모든 열을 정렬하고 싶습니다.
아래에 데이터 표를 첨부했습니다. 어떤 제안?

고마워, 재키!
자동화 및 스크립팅Re: 열 속성을 기준으로 열 정렬안녕하세요 @재키_ ,
나는 이와 같은 것이 당신이 원하는 것을 위해 작동하기를 기대합니다. 구문이 올바르지 않을 수 있지만 아이디어는 올바른 경로에 있습니다. 연관 배열을 사용하는 것이 내재적으로 항목을 오름차순/알파벳순으로 자동 정렬하기 때문에 가장 쉬운 경로라고 생각합니다.
나갔으니 참고하세요 group_tests_cols 비어 있는. "Tests"에서 그룹화했으므로 목록을 만들거나 목록을 만들기 위해 모든 열 이름을 검색하는 방법이 있을 것입니다.
Names default to here(1);
dt = current data table();
group_tests_cols = { };
// automatically sorts key data in ascending / alphabetical order
aa_tests_cols = Associative Array();
// Puts all of the test numbers as the keys in the AA
for( a = 1, a <= N Items( group_tests_cols ), a++,
test_number = column( dt, group_tests_cols[a] ) << Get Property( "Formula" );
eval( eval expr( aa_tests_cols[ expr( test_number ) ] ) ) = group_tests_cols[a];
);
aa_keys = aa_tests_cols << Get keys;
// Moves columns in the order of the keys
for( b = 1, b <= N Items( aa_keys ), b++,<BR /> col_name = aa_tests_cols[ aa_keys[b] ]; // uses index of the key to retrieve the actual value of the key, to get the col name
eval( eval expr( expr( column( dt, col_name ) ) << Move Selected Columns( expr( { as column( col_name ) } ), after( :name ) ) ) );
);
Re: 열 속성을 기준으로 열 정렬다음은 테스트 번호 값을 찾은 다음 이를 기반으로 열을 정렬하는 작업 스크립트입니다.
Names Default To Here( 1 );
dt = Current Data Table();
//Get the test numbers and the column names associated with them
valList = {};
testList = {};
For Each( {col}, dt << get column group( "Tests" ),
Show( col );
Insert Into( valList, Num( col << get property( "Test Number" ) ) );
Insert Into( testList, Char( col << get name ) );
);
// Sort the test numbers
sortedList = Sort List( valList );
// Loop through the test orders and reorder the columns
For Each( {test, index}, sortedList,
theCol = Contains( valList, sortedList[N Items( sortedList ) + 1 - index] );
dt << go to( testList[theCol] );
dt << Move Selected Columns( To first );
);
다른 사람들이 이 작업을 수행하는 더 좋은 방법을 가지고 있을 수 있습니다.
Re: 열 속성을 기준으로 열 정렬고마워, 짐!
Re: 열 속성을 기준으로 열 정렬이것이 JMP17보다 이전 버전에서 작동한다고 생각합니다.
Names Default To Here( 1 );
dt = Current Data Table();
aa = Associative Array();
For Each({col}, dt << get column group("Tests"),
aa[col << get name] = Num(col << get property("Test Number"));
);
Eval(EvalExpr(
dt << Move Selected Columns(Expr((aa << get keys)[Rank(aa << get values)]), To last)
));
JMP17(JMP17.0 이상)에서 선택한 열 이동 동작이 변경되었습니다(우연히). 선택한 열 이동이 목록과 함께 작동하는 이유가 JMP17에서 변경된 이유를 아십니까?
Re: 열 속성을 기준으로 열 정렬고마워, 자모!
Re: 열 속성을 기준으로 열 정렬@jthi 나는 JMP 17에서 이동 선택이 작동하지 않습니다.
다중 이동 선택한 열 명령은 성능에 따라 강력하지 않습니다. 선택한 열 이동이 목록과 함께 작동하는 이유가 JMP17에서 변경된 이유를 아십니까?
이에 대해 제안할 수 있는 해결 방법은 다음과 같습니다.
Names Default To Here( 1 );
dt = Current Data Table();
aa = Associative Array();
For Each({col}, dt << get column group("Tests"),
aa[col << get name] = Num(col << get property("Test Number"));
);
Eval(EvalExpr(
dt << Move Selected Columns(Expr((aa << get keys)[Rank(aa << get values)]), To last)
));
Re: 열 속성을 기준으로 열 정렬루프 내에서 선택한 열을 여러 번 이동하면 작동합니다. 먼저 열에 대한 순서 목록을 만든 다음 그에 따라 반복하면 됩니다.