Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
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
Highlighted
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
Highlighted
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
Highlighted
JensRiege
Level III

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.

Highlighted
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

Highlighted
Thomas1
Level V

Re: How to concatenate files and preserve formula columns

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

Highlighted
Thomas1
Level V

Re: How to concatenate files and preserve formula columns

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

Article Labels

    There are no labels assigned to this post.