<?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: Add new column with formula to data table at certain position in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Add-new-column-with-formula-to-data-table-at-certain-position/m-p/14605#M13626</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;True!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Oct 2015 18:01:11 GMT</pubDate>
    <dc:creator>gandi2223</dc:creator>
    <dc:date>2015-10-05T18:01:11Z</dc:date>
    <item>
      <title>Add new column with formula to data table at certain position</title>
      <link>https://community.jmp.com/t5/Discussions/Add-new-column-with-formula-to-data-table-at-certain-position/m-p/14602#M13623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it possible to add a new column to a data table (a) at a certain position (e.g. after a particular column) &lt;SPAN style="font-size: 13.3333px;"&gt;and (b) assign it a formula?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The New Column command can do (a) and the Add Multiple Columns command can do (b), but is there a way to get both done in one go?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like the command below (which does not give the desired result, however):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="_jivemacro_uid_14440520165775267 jive_macro_code jive_text_macro" jivemacro_uid="_14440520165775267" modifiedtitle="true"&gt;&lt;P&gt;dt &amp;lt;&amp;lt; New Column( "NewCol",&lt;/P&gt;&lt;P&gt;&amp;nbsp; After(:Col3),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Numeric,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Continuous,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Format( "Best", 5 ),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Formula( :Col3 * 2 )&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Oct 2015 13:36:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-new-column-with-formula-to-data-table-at-certain-position/m-p/14602#M13623</guid>
      <dc:creator>gandi2223</dc:creator>
      <dc:date>2015-10-05T13:36:20Z</dc:date>
    </item>
    <item>
      <title>Re: Add new column with formula to data table at certain position</title>
      <link>https://community.jmp.com/t5/Discussions/Add-new-column-with-formula-to-data-table-at-certain-position/m-p/14603#M13624</link>
      <description>&lt;P&gt;I think you need a couple of steps:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0px; font-size: 12px; line-height: normal; font-family: Courier; color: #942193;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open("$SAMPLE_DATA/Big Class.jmp");
WAit(2);
dt &amp;lt;&amp;lt; NewColumn("BMI", Numeric, Continuous, Formula(:weight/:height^2));
Wait(2);
dt &amp;lt;&amp;lt; MoveSelectedColumns({:BMI}, After(:sex));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P style="margin: 0px; font-size: 12px; line-height: normal; font-family: Courier; color: #011993;"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jun 2018 19:12:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-new-column-with-formula-to-data-table-at-certain-position/m-p/14603#M13624</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2018-06-13T19:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: Add new column with formula to data table at certain position</title>
      <link>https://community.jmp.com/t5/Discussions/Add-new-column-with-formula-to-data-table-at-certain-position/m-p/14604#M13625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you have your &lt;EM&gt;a&lt;/EM&gt; and &lt;EM&gt;b&lt;/EM&gt; mixed up. &lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;Add Multiple Columns&lt;/SPAN&gt; permits you to add the new columns at a specific point relative to other columns—Before First, After Last, or after a select column—and is otherwise quite limited with what you can preset for the new columns. &lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;New Column&lt;/SPAN&gt; will permit you to set any number of column properties such as a formula, but lacks a parameter for placement. As Ian suggested, the way to achieve what you want is to define the new column using &lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;New Column&lt;/SPAN&gt; then use &lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;Move Selected Columns&lt;/SPAN&gt; to place the column in the data table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Oct 2015 17:45:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-new-column-with-formula-to-data-table-at-certain-position/m-p/14604#M13625</guid>
      <dc:creator>mdawson69</dc:creator>
      <dc:date>2015-10-05T17:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: Add new column with formula to data table at certain position</title>
      <link>https://community.jmp.com/t5/Discussions/Add-new-column-with-formula-to-data-table-at-certain-position/m-p/14605#M13626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;True!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Oct 2015 18:01:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-new-column-with-formula-to-data-table-at-certain-position/m-p/14605#M13626</guid>
      <dc:creator>gandi2223</dc:creator>
      <dc:date>2015-10-05T18:01:11Z</dc:date>
    </item>
  </channel>
</rss>

