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

Simplest way to save/use column formulas

Hello,

I have created around 10 column formulas in a data table that I would like to save and use on other data tables in the future.

Wondering if there is a way to save and import these formulas without having to retype them each time.

Thanks,

JP

1 ACCEPTED SOLUTION

Accepted Solutions
ian_jmp
Staff

Re: Simplest way to save/use column formulas

One way would be to save the table you have with a new name ('Template'), then delete all the rows therein and save it again. You can then just append rows to this template when new data arrives.

If you want to look at individual formulas, you can 'Copy Table Script' from the red triangle of 'Template', then do 'File > New > New Script' and paste the contents there.

View solution in original post

4 REPLIES 4
ian_jmp
Staff

Re: Simplest way to save/use column formulas

One way would be to save the table you have with a new name ('Template'), then delete all the rows therein and save it again. You can then just append rows to this template when new data arrives.

If you want to look at individual formulas, you can 'Copy Table Script' from the red triangle of 'Template', then do 'File > New > New Script' and paste the contents there.

Craige_Hales
Super User

Re: Simplest way to save/use column formulas

Right-Click at the top of a formula column, pick Copy Column Properties.  You can then Paste Column Properties in a new column.  Try the copy and paste Multiple Column Properties; it might be what you are looking for.  Select several formula columns first.  Before the paste, make several new columns and select them.  The paste buffer contains the text of the formulas, like this:

{Add Column Properties( Formula( :a + :p ) ),

Add Column Properties( Formula( :a - :p ) )}

and you could save that text for later.  Re-copy it, then Paste Column Properties again. 

or...

Copy and paste works in the formula editor (right-click at the top of the column, pick Formula Editor):

7992_tableAplusB.png

or...

You can also script the formula; use the red triangle at the top left of the table and Copy Table Script.

New Table( "Untitled 2",

    Add Rows( 1 ),

    New Column( "a",Numeric,"Continuous",Format( "Best", 12 ),Set Values( [1] )    ),

    New Column( "b",Numeric,"Continuous",Format( "Best", 12 ),Set Values( [2] )    ),

    New Column( "c",Numeric,"Continuous",Format( "Best", 12 ),Formula( :a + :p )    )

);

You can use the JSL editor to build scripts to make your tables with the formulas.

Craige

Re: Simplest way to save/use column formulas

Hi all,

I ended up writing a script with formulas to build new columns.

Copying Column Properties also worked, but it was a bit shaky if multiple columns were copied/pasted at once. Worked fine for one column copied at a time.

Thanks for the help!

Re: Simplest way to save/use column formulas

I use this technique frequently.


With my data table formulas in use, I create a subset of my data (first row) and copy table script. Paste it into a new script window and delete all of the data code, leaving just the formulas. With a bit of cleaning up, it works.