Subscribe Bookmark RSS Feed

Simplest way to save/use column formulas

jason_paquette

Community Trekker

Joined:

Jan 26, 2015

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
Solution

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.

4 REPLIES
Solution

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

Staff

Joined:

Mar 21, 2013

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 + :b ) ),

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

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 + :b )    )

);

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

Craige
jason_paquette

Community Trekker

Joined:

Jan 26, 2015

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!

jason_paquette

Community Trekker

Joined:

Jan 26, 2015

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.