Fill a column vertically from two different data tableHi
I am new to JSL. I have to merge to columns vertically to a new column something like below. Any help is appreciated.

Re: Fill a column vertically from two different data table@adnan019 ,
There are multiple ways to do this. I will show you a few:
// Create Data Set 1
dt = New Table("Character Data");
dt << New Column("CharacterSet",Character,Nominal,<< Set Values({"A","B","C"}));
// Create Data Set 2
dt1 = New Table("Numerical Data");
dt1 << New Column("NumericalSet",Character,Nominal,<< Set Values({"1","2","3"}));
// Approach -1
dt2 = dt1 << Concatenate( dt);
dt2 << New Column("ConcatenatedData",Character,Nominal,Formula(If(IsMissing(:CharacterSet),:NumericalSet,:CharacterSet)));
// Approach - 2
ValsFromTable1 = dt:CharacterSet << Get Values;
ValsFromTable2 = dt1:NumericalSet << Get Values;
AllData = ValsFromTable1 || ValsFromTable2;
dt3 = New Table ();
dt3 << New Column("ConcatenatedSet",Character,Nominal,<<SET values=""></SET> Note that I modeled the numerical data as character, this is to enable the concatenation
Re: Fill a column vertically from two different data tableOr interactively:
First make sure the data type is for both columns character (or at least the same), otherwise concatenation won't work.
- Using tables menu, "stack" will do what you want. Select your two or whatever number of columns and drag them on the "Stack Column" role.
- Deselect "Stack by Row" to have a true concatenation
- May modify Data, Label, and output table name and press ok

That's it.
And of course in the Source Script of the table you find the JSL approach:
Data Table( "MyData" ) << Stack(
columns( :Col 1, :Col 2 ),
Source Label Column( "Label" ),
Stacked Data Column( "Data" ),
Stack By Row( 0 )
)
I like the others from Uday, too.
Best
Martin
Re: Fill a column vertically from two different data tableThanks. The || sign worked for me.
Re: Fill a column vertically from two different data tableThanks Martin. Interactively that is also helpful.