大家好,
我的脚本需要帮助。 我有一个脚本,可以从原始数据表创建一个汇总表,如下所示;
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。