Subscribe Bookmark RSS Feed

Join Data Table to existing Data Table with No Output Table?

aandw

Community Trekker

Joined:

Mar 12, 2015

I would like to join a series of similarly structured data tables to an existing "master" data table.

I do not want to create an output table after every join command is complete.

I want the subsequent data tables to continue joining (and compiling) onto the master data table.

A similar command is "Append to first table" under dt << concatenate( data table ( ...

e.x

/* Join (merge)  scenarios */

dt = Open("H:\original.jmp");

dt << Set Name("MASTER");

// Open Subsequent files to join onto Master

dt = Open("H:\scenario1.jmp");

Data Table( "MASTER" ) << Join(

  With( Data Table( "scenario1" ) ),

  Merge Same Name Columns,

  By Matching Columns(

  :Year = :Year,

  :Month = :Month,

  :Route = :Route

  ),

  Drop multiples( 1, 0 ),

  Name( "Include non-matches" )(1, 0),

  Preserve main table order( 1 ),

// No Output Table Command Needed HERE

// Output Table( "name"),

  );

1 REPLY
aandw

Community Trekker

Joined:

Mar 12, 2015

Sorry, simple function.

Use UPDATE command.

// Update Data Table by Merging on Same Name Columns

// New Columns merge onto existing data table.

Data Table( "MASTER" ) << Update(

  With( Data Table( "scenario1" ) ),

  Merge Same Name Columns,

  By Matching Columns(

  :Year = :Year,

  :Month = :Month,

  :Route = :Route

  ),

  Drop multiples( 1, 0 ),

  Name( "Include non-matches" )(1, 0),

  Preserve main table order( 1 ),

  //No Output,

  );