I Have a list of open tables (names) that I want to concatenate and add a new “Source Column” that can be retrieved from the same list of table names. I have tried all the previous “solutions: published on this Discussion board without luck (only partial luck)
I can get my concatenated tables following a solution published by TXNelson, but I cannot seem to be able to get the “Source Column” to work. I will appreciate any help solving this one.
tables = {"R1", "R2", "R3"};
TablesN ={};
For(k = 1, k <= n Rows ( Data Table(tables[i] )),k++,
Insert Into(TablesN, Data Table (tables [i] ) << get name));
// the concatenation works like a charm
Data Table = New Table ("RST");
For( i = 1, i <= N Items( tables ), i++,
Data Table( "RST" ) << Concatenate(
Data Table( tables[i] ),
append to first table(1)
);
//Close( Data Table( tables[i] ), No Save );
);
// this part fails
data table( "RST" ) << add multiple columns("Source Table", 1, before first, character );
:Source Table << set values( TablesN );