cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
Thomas1
Level V

How to concatenate files and preserve formula columns

I'd like to concatenate a main file withe a new file. The main file contains a formula column, the new file not. The resulting file should have the formula column with the formula from the main file.

Additional the new file should be renamed to the name of of main file and the the former main file and the new file should be closed and not saved.

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Jeff_Perkinson
Community Manager Community Manager

Re: How to concatenate files and preserve formula columns

To avoid the creation of a new data table and having to deal with renaming you can use the Append to first table option.

Names Default To Here( 1 );
dtMain = Data Table( "MainFile" );
dtNew = Data Table( "NewFile" );
dtConcat = dtMain << Concatenate( dtNew, Append to first table, Keep Formulas );

 

 

-Jeff

View solution in original post

5 REPLIES 5
txnelson
Super User

Re: How to concatenate files and preserve formula columns

The main part of the JSL below, was obtained by running the Concatenate platform interactively to get what was desired, and then taking the JSL from the Source of the new table and pasting it into the script.

Names Default To Here( 1 );
dtMain = Data Table( "MainFile" );
dtNew = Data Table( "NewFile" );
dtConcat = dtMain << Concatenate( dtNew, Keep Formulas );

concatName = dtMain << get name;

Close( dtMain, nosave );
Close( dtNew, nosave );

dtConcat << set name( concatName );
Jim
JensRiege
Level IV

Re: How to concatenate files and preserve formula columns

Thanks txNelson for this useful post. I was just working on the exact same issue , and the "keep formulas" parameter solves my problem.

Jeff_Perkinson
Community Manager Community Manager

Re: How to concatenate files and preserve formula columns

To avoid the creation of a new data table and having to deal with renaming you can use the Append to first table option.

Names Default To Here( 1 );
dtMain = Data Table( "MainFile" );
dtNew = Data Table( "NewFile" );
dtConcat = dtMain << Concatenate( dtNew, Append to first table, Keep Formulas );

 

 

-Jeff
Thomas1
Level V

Re: How to concatenate files and preserve formula columns

Thanks Jeff. The append to ... command makes it even better.

Thomas1
Level V

Re: How to concatenate files and preserve formula columns

Thanks Jim. That's what I was looking for.