Subscribe Bookmark RSS Feed

How to joining two columns with JSL

pomemelom

New Contributor

Joined:

Jan 31, 2017

Hi I am new to JSL, and I got stuck in a seemlily easy task.

Say I have two columns A and B, and have some missing values.

I'd like to create a new column to be the join of column A and B.

As shown in example below. 

 

Thanks!

 

Snap278.bmp

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson

Super User

Joined:

Jun 22, 2012

Solution

Here is a couple of simple examples

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );

dt << New Column( "New Column", character, formula( name || sex ) );

// or 
dt << New Column( "Second New Column", character );
For( i = 1, i <= N Rows( dt ), i++,
	dt:Second New Column[i] = dt:name[i] || dt:sex[i]
)are 
Jim
1 REPLY
txnelson

Super User

Joined:

Jun 22, 2012

Solution

Here is a couple of simple examples

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );

dt << New Column( "New Column", character, formula( name || sex ) );

// or 
dt << New Column( "Second New Column", character );
For( i = 1, i <= N Rows( dt ), i++,
	dt:Second New Column[i] = dt:name[i] || dt:sex[i]
)are 
Jim