Ciao a tutti,
Ho bisogno di aiuto con il mio script. Ho uno script che crea una tabella di riepilogo dalla tabella dei dati grezzi come di seguito;
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" );
******
Ora devo rinominare automaticamente la colonna del sottogruppo. La data cambierà ogni giorno.
voglio passare dal formato corrente -- rcr%(:date_) al formato -- :date_
Alla fine non voglio alcuna parola rcr% davanti alla data.

Ecco una modifica al tuo script.La prima modifica è dare un nome alla tabella riepilogativa
Output Table( "My Summary" )
La seconda modifica scorre tutte le colonne nella nuova tabella e modifica qualsiasi colonna il cui nome inizia con "rcr%" e cambia il nome.
// 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 ) )
)
);
Ecco la sceneggiatura completa
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 ) )
)
);
Inoltre, inserisci il tuo JSL nelle discussioni utilizzando il file
icona che visualizza il JSL in un formato più semplice per i membri della comunità leggere e comprendere il problema.