cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
AsymptoticCos
Level II

Create a new concatenated table based on two existing tables

Hi, I have input table A that looks like this, 

 

AsymptoticCos_0-1718049427700.png

 

Input Table B looks like this, 

AsymptoticCos_1-1718049469170.png

I want to create an output table C: that should look like this, 

AsymptoticCos_2-1718049508970.png

I can do this manually. Is there a way to script this? 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
hogi
Level XI

Re: Create a new concatenated table based on two existing tables

Tables/Join can do the Job - use as match specification Cartesian Join:

hogi_0-1718051388933.png

 

The column names in both tables should differ from each other, otherwise the name of the source table will be added to the column name.

 

dt1 = New Table( "dt1",
	Add Rows( 3 ),
	New Column( "Column 1", Character, Set Values( {"A", "B", "C"} ) ),
	New Column( "Column 2",	Set Values( [1, 2, 3] )	),
	New Column( "Column 3",	Set Values( [1, 2, 3] )	)
);

dt2 = New Table( "dt2",
	Add Rows( 3 ),
	New Column( "Column 4",
		Character,
		Set Values( {"X", "Y", "Z"} )
	)
);

dt1 << Join(
	With( dt2 ),
	Cartesian Join
); 


 

View solution in original post

1 REPLY 1
hogi
Level XI

Re: Create a new concatenated table based on two existing tables

Tables/Join can do the Job - use as match specification Cartesian Join:

hogi_0-1718051388933.png

 

The column names in both tables should differ from each other, otherwise the name of the source table will be added to the column name.

 

dt1 = New Table( "dt1",
	Add Rows( 3 ),
	New Column( "Column 1", Character, Set Values( {"A", "B", "C"} ) ),
	New Column( "Column 2",	Set Values( [1, 2, 3] )	),
	New Column( "Column 3",	Set Values( [1, 2, 3] )	)
);

dt2 = New Table( "dt2",
	Add Rows( 3 ),
	New Column( "Column 4",
		Character,
		Set Values( {"X", "Y", "Z"} )
	)
);

dt1 << Join(
	With( dt2 ),
	Cartesian Join
);