<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Copying Formula columns from one table to another (Column name included) in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Copying-Formula-columns-from-one-table-to-another-Column-name/m-p/272283#M52958</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/3991"&gt;@pcarroll1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;If you select the formula columns you want to copy from the source table, right-click the header of one of them and select "Copy Columns"; then right-click the header of the first empty column to the right of your destination table data and select "Paste Columns" - I think you'll get what you're after.&amp;nbsp; BTW, right-clicking an existing column in the destination table will insert the new formula columns immediately after that column.&lt;/P&gt;</description>
    <pubDate>Thu, 11 Jun 2020 21:26:26 GMT</pubDate>
    <dc:creator>jerry_cooper</dc:creator>
    <dc:date>2020-06-11T21:26:26Z</dc:date>
    <item>
      <title>Copying Formula columns from one table to another (Column name included)</title>
      <link>https://community.jmp.com/t5/Discussions/Copying-Formula-columns-from-one-table-to-another-Column-name/m-p/271908#M52906</link>
      <description>&lt;P&gt;I often need to copy a series of formula columns from one table to another.&amp;nbsp; Although "Copy Multi Column Properties" makes that job easier, it does not include the column name.&amp;nbsp; As my column names can be quite long, it is time consuming to do this, even using cut and paste, since there can be many of these columns.&amp;nbsp; Is there an easy method to copy the properties (formula, name and all) from one table to another?&amp;nbsp; I realize that I can write a script to do this, but thought maybe I was unaware of some option.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:14:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Copying-Formula-columns-from-one-table-to-another-Column-name/m-p/271908#M52906</guid>
      <dc:creator>pcarroll1</dc:creator>
      <dc:date>2023-06-10T23:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: Copying Formula columns from one table to another (Column name included)</title>
      <link>https://community.jmp.com/t5/Discussions/Copying-Formula-columns-from-one-table-to-another-Column-name/m-p/271939#M52907</link>
      <description>&lt;P&gt;I have the script below saved in the Cols menu using in add-in and use it all the time, both when writing scripts to recreate what I did visually and to copy columns from one table to another.&amp;nbsp; Select columns in your source table, run this script, select your target data table, open a new script window, paste what was saved to the clipboard and hit run.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names default to here(1);
ColumnList = Current Data Table() &amp;lt;&amp;lt; Get Selected Columns();
ScriptOut = "";
for( i = 1, i &amp;lt;= n items(ColumnList), i++,
	ThisScript = Char(Column( Current Data Table(), ColumnList[i] ) &amp;lt;&amp;lt; Get Script) || ";";
	ThisScript = substitute( ThisScript, ", Set Selected", "" );
	ScriptOut = ScriptOut || If( i &amp;gt; 1, "\!N", "" ) || ThisScript;
);

Set clipboard( ScriptOut );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Example code saved to the clipboard:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New Column("Sepal length Lagged", Numeric, "Continuous", Format("Best", 10), Formula(Lag(As Column("Sepal length"), 1)));
New Column("Sepal width Lagged", Numeric, "Continuous", Format("Best", 10), Formula(Lag(As Column("Sepal width"), 1)));
New Column("Petal length Lagged", Numeric, "Continuous", Format("Best", 10), Formula(Lag(As Column("Petal length"), 1)));
New Column("Petal width Lagged", Numeric, "Continuous", Format("Best", 10), Formula(Lag(As Column("Petal width"), 1)));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Jun 2020 19:55:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Copying-Formula-columns-from-one-table-to-another-Column-name/m-p/271939#M52907</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2020-06-10T19:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: Copying Formula columns from one table to another (Column name included)</title>
      <link>https://community.jmp.com/t5/Discussions/Copying-Formula-columns-from-one-table-to-another-Column-name/m-p/271944#M52908</link>
      <description>&lt;P&gt;There is something that you are not aware of!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Open the source and the destination data tables.&lt;/LI&gt;
&lt;LI&gt;Select the original columns in the first data table.&lt;/LI&gt;
&lt;LI&gt;Press and hold the Control key with Windows or the Command key with Macintosh.&lt;/LI&gt;
&lt;LI&gt;Drag the original columns from the source data table to the destination data table.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 10 Jun 2020 19:30:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Copying-Formula-columns-from-one-table-to-another-Column-name/m-p/271944#M52908</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2020-06-10T19:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: Copying Formula columns from one table to another (Column name included)</title>
      <link>https://community.jmp.com/t5/Discussions/Copying-Formula-columns-from-one-table-to-another-Column-name/m-p/271949#M52910</link>
      <description>&lt;P&gt;OK, I rushed that one!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This operation does not carry column properties over to the destination. Only the data values and column attributes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A simple drag (without modifier key) will move the columns from one table to another instead of copying them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also right-click on the selected data columns in the source data table and select copy column properties or copy columns, but this way does not copy the values!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I guess there is no simple way to get what you want in one step. If you have many columns to re-use, then the script might be the best way. I was trying to illustrate that there is a lot of capability through the UI.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 19:41:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Copying-Formula-columns-from-one-table-to-another-Column-name/m-p/271949#M52910</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2020-06-10T19:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: Copying Formula columns from one table to another (Column name included)</title>
      <link>https://community.jmp.com/t5/Discussions/Copying-Formula-columns-from-one-table-to-another-Column-name/m-p/272283#M52958</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/3991"&gt;@pcarroll1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;If you select the formula columns you want to copy from the source table, right-click the header of one of them and select "Copy Columns"; then right-click the header of the first empty column to the right of your destination table data and select "Paste Columns" - I think you'll get what you're after.&amp;nbsp; BTW, right-clicking an existing column in the destination table will insert the new formula columns immediately after that column.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jun 2020 21:26:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Copying-Formula-columns-from-one-table-to-another-Column-name/m-p/272283#M52958</guid>
      <dc:creator>jerry_cooper</dc:creator>
      <dc:date>2020-06-11T21:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: Copying Formula columns from one table to another (Column name included)</title>
      <link>https://community.jmp.com/t5/Discussions/Copying-Formula-columns-from-one-table-to-another-Column-name/m-p/272287#M52959</link>
      <description>&lt;P&gt;Sorry&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/3991"&gt;@pcarroll1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;It just dawned on me that you're probably not using version 15 - I believe this is a new feature.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can do what you want in previous versions, although, as you mentioned, the column names do not convey. However,&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;there is a method for copying multiple column names from one table to another.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After you've pasted the formula columns into the new table (with "Paste Multi Column Properties"), go back to your source table (be sure that your formula columns are still selected), then click on the header bar in the "Columns" panel:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jerry_cooper_1-1591914257273.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/24553i810237D86ABB63F7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jerry_cooper_1-1591914257273.png" alt="jerry_cooper_1-1591914257273.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Type Ctrl-C to copy the column names.&amp;nbsp; Then go back to the destination table and ensure that your new formula columns are still selected, click on the Columns header and then type Ctrl-V to paste the column names. Obviously, you'll need to make sure that you haven't changed the order of the columns in either table before doing this, otherwise, your columns won't be named correctly.&amp;nbsp; It's a couple of extra steps, but not as daunting as re-typing a bunch of long names.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jun 2020 22:26:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Copying-Formula-columns-from-one-table-to-another-Column-name/m-p/272287#M52959</guid>
      <dc:creator>jerry_cooper</dc:creator>
      <dc:date>2020-06-11T22:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: Copying Formula columns from one table to another (Column name included)</title>
      <link>https://community.jmp.com/t5/Discussions/Copying-Formula-columns-from-one-table-to-another-Column-name/m-p/272417#M52981</link>
      <description>&lt;P&gt;jerry_cooper,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; This worked great.&amp;nbsp; I did not know about copying names from the Column Panel. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; You're right that I don't yet have JMP15 but hope to get it after my companies merger goes through.&lt;/P&gt;&lt;P&gt;Pat&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 14:48:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Copying-Formula-columns-from-one-table-to-another-Column-name/m-p/272417#M52981</guid>
      <dc:creator>pcarroll1</dc:creator>
      <dc:date>2020-06-12T14:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Copying Formula columns from one table to another (Column name included)</title>
      <link>https://community.jmp.com/t5/Discussions/Copying-Formula-columns-from-one-table-to-another-Column-name/m-p/272422#M52983</link>
      <description>I should have also added this little tidbit. Since some of my formulas referred to some of the other new column names, those formulas failed when I used the order that you suggested. All the column formulas worked when I first copied the names and then the formulas.</description>
      <pubDate>Fri, 12 Jun 2020 14:58:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Copying-Formula-columns-from-one-table-to-another-Column-name/m-p/272422#M52983</guid>
      <dc:creator>pcarroll1</dc:creator>
      <dc:date>2020-06-12T14:58:12Z</dc:date>
    </item>
  </channel>
</rss>

