大家好,
我的腳本需要幫助。 我有一個腳本,可以從原始資料表建立一個匯總表,如下所示;
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。