Salut tout le monde,
J'ai besoin d'aide avec mon script. J'ai un script qui crée un tableau récapitulatif à partir du tableau de données brutes comme ci-dessous ;
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" );
******
Maintenant, je dois renommer automatiquement la colonne du sous-groupe. La date changera tous les jours.
je veux passer du format actuel -- rcr%(:date_) au format -- :date_
En fin de compte, je ne veux pas de mot rcr% devant la date.

Voici une modification de votre script.La première modification donne un nom au tableau récapitulatif
Output Table( "My Summary" )
La deuxième modification parcourt toutes les colonnes de la nouvelle table et modifie toute colonne dont le nom commence par « rcr% » et change le nom.
// 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 ) )
)
);
Voici le script complet
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 ) )
)
);
Veuillez également saisir votre JSL dans les discussions en utilisant le
icône qui affiche le JSL dans un format plus facile à lire et à comprendre pour les membres de la communauté.