how do I change column 1 name from all open data tableopenDTs = List();
For( i = 1, i <= N Table(), i++,
Hello All,
I want to change the column name from all open data table, but my script only changed the last data table, would you please help?
openDTs = List();
For( i = 1, i <= N Table(), i++,
Insert Into( openDTs, Data Table( i ) ));
For( i = 1, i <= N Items(openDTs), i++,
column(1)<<openDTs[i]<<set name("DATE");
show(openDTs[i]));
Re: how do I change column 1 name from all open data tableThank you very much, it works
Re: how do I change column 1 name from all open data tablethis should work
Names Default To Here( 1 );
openDTs = List();
For( i = 1, i <= N Table(), i++,
Insert Into( openDTs, Data Table( i ) )
);
For( i = 1, i <= N Items( openDTs ), i++,
Column( openDTs[i], 1 ) << set name( "DATE" );
Show( xx );
);
Re: how do I change column 1 name from all open data tableThe way your code is written now does not work because Column(1) references the first column in the current data table and therefore will only change the column name of a single table. It seems like your placement of openDTs[i] is a little off. Below is how you would address this.
openDTs = List();
For( i = 1, i <= N Table(), i++,
Insert Into( openDTs, Data Table( i ) )
);
For( i = 1, i <= N Items( openDTs ), i++,
Column( openDTs[i], 1 ) << set name( "DATE" )
);
However, a better way to do this is to only use a single loop and set the name of the column use the Data Table function with a table index. This avoids looping to create a list and then looping that list to set the names.
For( i = 1, i <= N Table(), i++,
Column( Data Table( i ), 1 ) << set name( "DATE" )
);