Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Discussions
- :
- Copy Columns With Formulas

Topic Options

- Start Article
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Sep 13, 2010 12:31 PM
(7492 views)

Is it possible to copy columns along with their formulas from one table to another? I have a table with 21 columns, each with their own unique formula, and I need to apply those formulas to a new dataset. Without having to copy the formulas one at a time, how do I do this?

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

MS,

Working the problem the other way around as you suggested worked the easiest for me. I tried LauraL's suggestion, but ran into big trouble when I tried to run get script; with all the data still in the table. Once I deleted all the data get script; worked fine, and I'll be sure to keep that in my bag of tricks, but once I have all the data deleted it's just as easy to save that reduced table as a template then copy in the new data as required.

Thanks to everyone for all your help,

Mark

Working the problem the other way around as you suggested worked the easiest for me. I tried LauraL's suggestion, but ran into big trouble when I tried to run get script; with all the data still in the table. Once I deleted all the data get script; worked fine, and I'll be sure to keep that in my bag of tricks, but once I have all the data deleted it's just as easy to save that reduced table as a template then copy in the new data as required.

Thanks to everyone for all your help,

Mark

5 REPLIES 5

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Copy Columns With Formulas

I don't know. I remember vaguely that there was a trick in a much earlier version of JMP, but I can't figure it out now in JMP 8.

However, why not do it the other way around? Paste the new data set in a copy of the table where you keep your formulas. If the new set is smaller (=fewer rows) than the old you may need to delete redundant rows first.

Or alternatively from the Tables menu, choose "Join" or "Subset" and "Join" in series to combine the formulas with the new data ("copy formulas" must be checked).

However, why not do it the other way around? Paste the new data set in a copy of the table where you keep your formulas. If the new set is smaller (=fewer rows) than the old you may need to delete redundant rows first.

Or alternatively from the Tables menu, choose "Join" or "Subset" and "Join" in series to combine the formulas with the new data ("copy formulas" must be checked).

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Working the problem the other way around as you suggested worked the easiest for me. I tried LauraL's suggestion, but ran into big trouble when I tried to run get script; with all the data still in the table. Once I deleted all the data get script; worked fine, and I'll be sure to keep that in my bag of tricks, but once I have all the data deleted it's just as easy to save that reduced table as a template then copy in the new data as required.

Thanks to everyone for all your help,

Mark

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Copy Columns With Formulas

- on a dialog window select a radio button with data table from which you want to copy columns with formula;click "Copy Formula"

- edit script in the script window, if needed;

- select new data table in which new columns with formula need to be created; click "Paste Formula". The script will run against selected table.

Hope this helps.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Copy Columns With Formulas

aim,

After I played around with LauraL's suggestion, I gave your response a try and it works brilliantly! Thank you so much!

Mark

After I played around with LauraL's suggestion, I gave your response a try and it works brilliantly! Thank you so much!

Mark

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Copy Columns With Formulas

If you need to repeated add the same formula columns to new data tables, you are better off creating a script with those columns.

The easiest way is to get the script for the original data table.

data table("Original") << get script;

Now the script appears in the log. Just copy and paste into a new script, keeping only the bits related to adding the the formula columns.

Note that you may need to reformat the script once you paste it in. On my computer it appears on one row until after reformatting.

The easiest way is to get the script for the original data table.

data table("Original") << get script;

Now the script appears in the log. Just copy and paste into a new script, keeping only the bits related to adding the the formula columns.

Note that you may need to reformat the script once you paste it in. On my computer it appears on one row until after reformatting.