안녕하세요 여러분,
내 스크립트에 도움이 필요합니다. 아래와 같이 원시 데이터 테이블에서 요약 테이블을 생성하는 스크립트가 있습니다.
Data Table( "DVIRCR_SumTable" ) << Summary(
Group( :prodgroup3, :subapp ),
Max( :rcr% ),
Subgroup( :date_ ),
Freq( "None" ),
Weight( "None" ),
statistics column name format( "column" ),
Link to original data table( 0 )
);
//rename N Rows column to Lot Count
:Name( "N Rows" ) << Set Name( "Lot Count" );
******
이제 하위 그룹 열의 이름을 자동으로 바꿔야 합니다. 날짜는 매일 바뀌게 됩니다.
현재 형식 -- rcr%(:date_) 에서 -- :date_ 형식으로 변경하고 싶습니다.
궁극적으로 나는 날짜 앞에 어떤 rcr% 단어도 붙이고 싶지 않습니다.

다음은 스크립트 수정 사항입니다.첫 번째 수정은 요약 테이블에 이름을 지정하는 것입니다.
Output Table( "My Summary" )
두 번째 수정은 새 테이블의 모든 열을 반복하고 이름이 "rcr%"로 시작하는 열을 변경하고 이름을 변경합니다.
// Create a list of all of the column
colNames = Data Table( "My Summary" ) << get column names( string );
// Loop through all of the names, and when "rcr%," is found in the
// start of the column name, change the name to the column name
// starting from the 7th character in the name
For Each( {col}, colNames,
If( Contains( col, "rcr%," ) == 1,
Column( col ) << set name( Substr( col, 7 ) )
)
);
전체 스크립트는 다음과 같습니다.
Names Default to Here( 1 );
Data Table( "DVIRCR_SumTable" ) << Summary(
Group( :prodgroup3, :subapp ),
Max( :rcr% ),
Subgroup( :date_ ),
Freq( "None" ),
Weight( "None" ),
statistics column name format( "column" ),
Link to original data table( 0 ),
Output Table( "My Summary" )
);
//rename N Rows column to Lot Count
:Name( "N Rows" ) << Set Name( "Lot Count" );
// Create a list of all of the column
colNames = Data Table( "My Summary" ) << get column names( string );
// Loop through all of the names, and when "rcr%," is found in the
// start of the column name, change the name to the column name
// starting from the 7th character in the name
For Each( {col}, colNames,
If( Contains( col, "rcr%," ) == 1,
Column( col ) << set name( Substr( col, 7 ) )
)
);
또한 다음을 사용하여 JSL을 토론에 입력하십시오.
커뮤니티 구성원이 문제를 더 쉽게 읽고 이해할 수 있는 형식으로 JSL을 표시하는 아이콘입니다.