<?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: How to modify(overwrite) existing column with formula in datatable in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-modify-overwrite-existing-column-with-formula-in/m-p/242577#M47901</link>
    <description>&lt;P&gt;Using a formula to modify a column that has already existing static values will not work.&amp;nbsp; However, you can use JSL to modify the static values&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For Each Row(
     :Petal Length = :Petal Length/100;
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 23 Jan 2020 19:21:24 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2020-01-23T19:21:24Z</dc:date>
    <item>
      <title>How to modify(overwrite) existing column with formula in datatable</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-modify-overwrite-existing-column-with-formula-in/m-p/242566#M47899</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I 'm new to JMP and would like to know how can I modify one of a column in my data table. Let's say we have iris data and would like to divide Petal length column / 100. I opened formula tab by right clicking Petal lenght and input my formula. In the end I got • in the column. What is the correct way to do this ?&lt;BR /&gt;thanks&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="joshua_0-1579806698625.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/21177i6D641D8EBC76A908/image-size/medium?v=v2&amp;amp;px=400" role="button" title="joshua_0-1579806698625.png" alt="joshua_0-1579806698625.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 19:16:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-modify-overwrite-existing-column-with-formula-in/m-p/242566#M47899</guid>
      <dc:creator>joshua</dc:creator>
      <dc:date>2020-01-23T19:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify(overwrite) existing column with formula in datatable</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-modify-overwrite-existing-column-with-formula-in/m-p/242573#M47900</link>
      <description>&lt;P&gt;Your formula column needs to go into a DIFFERENT column. You need to have the original data available in order to do the calculation. So, create a new column, maybe called Scaled Petal Width, and create the formula just as you have it now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can't overwrite the original column of data as that could cause a real conflict. Think of it this way. If you enter the formula in the column of original data, all of the values are divided by 100. But you still have a formula that says to change the entries to be divided by 100, so it should do that again. It would never stop. Further, displaying the original values along with the calculated values provides data integrity.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, if you REALLY want to overwrite, you can do so through scripting and is naturally more difficult. You would also not have the formula embedded in the column.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 19:22:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-modify-overwrite-existing-column-with-formula-in/m-p/242573#M47900</guid>
      <dc:creator>Dan_Obermiller</dc:creator>
      <dc:date>2020-01-23T19:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify(overwrite) existing column with formula in datatable</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-modify-overwrite-existing-column-with-formula-in/m-p/242577#M47901</link>
      <description>&lt;P&gt;Using a formula to modify a column that has already existing static values will not work.&amp;nbsp; However, you can use JSL to modify the static values&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For Each Row(
     :Petal Length = :Petal Length/100;
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Jan 2020 19:21:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-modify-overwrite-existing-column-with-formula-in/m-p/242577#M47901</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-01-23T19:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify(overwrite) existing column with formula in datatable</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-modify-overwrite-existing-column-with-formula-in/m-p/242579#M47902</link>
      <description>&lt;P&gt;That's I don't want to do. In my real data table I have hundreds of columns and I just want to simply a simple math some of the. If I add more columns and have custom column names that increases the work I need to do! There should be I way around this.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 19:22:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-modify-overwrite-existing-column-with-formula-in/m-p/242579#M47902</guid>
      <dc:creator>joshua</dc:creator>
      <dc:date>2020-01-23T19:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify(overwrite) existing column with formula in datatable</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-modify-overwrite-existing-column-with-formula-in/m-p/242580#M47903</link>
      <description>Where should I put this script? to formula window or somewhere else ?</description>
      <pubDate>Thu, 23 Jan 2020 19:22:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-modify-overwrite-existing-column-with-formula-in/m-p/242580#M47903</guid>
      <dc:creator>joshua</dc:creator>
      <dc:date>2020-01-23T19:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify(overwrite) existing column with formula in datatable</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-modify-overwrite-existing-column-with-formula-in/m-p/242581#M47904</link>
      <description>&lt;P&gt;You put the script that Jim provided in a script window. Choose File &amp;gt; New &amp;gt; Script. Paste the script in there and run.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 19:24:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-modify-overwrite-existing-column-with-formula-in/m-p/242581#M47904</guid>
      <dc:creator>Dan_Obermiller</dc:creator>
      <dc:date>2020-01-23T19:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify(overwrite) existing column with formula in datatable</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-modify-overwrite-existing-column-with-formula-in/m-p/242582#M47905</link>
      <description>&lt;P&gt;Wow! That worked. But it gave it to me 0's. ie 1.4/100 I think is not equal to 0.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 19:28:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-modify-overwrite-existing-column-with-formula-in/m-p/242582#M47905</guid>
      <dc:creator>joshua</dc:creator>
      <dc:date>2020-01-23T19:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify(overwrite) existing column with formula in datatable</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-modify-overwrite-existing-column-with-formula-in/m-p/242583#M47906</link>
      <description>&lt;P&gt;I strongly recommend you go through the JMP Welcome Kit&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; Help==&amp;gt;JMP on the Web==&amp;gt;JMP Welcome Kit&lt;/P&gt;
&lt;P&gt;and take the time to read the documentation, Discovering JMP and Using JMP.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; Help==&amp;gt;JMP Documentation Library&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 19:30:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-modify-overwrite-existing-column-with-formula-in/m-p/242583#M47906</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-01-23T19:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify(overwrite) existing column with formula in datatable</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-modify-overwrite-existing-column-with-formula-in/m-p/242585#M47907</link>
      <description>&lt;P&gt;In addition how can I apply this formula to the columns contains certain strings. In this iris data set lets say 'length' is the string that I want to modify those column names that contains that.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="joshua_0-1579807814183.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/21178iBD3838DE8D69EE77/image-size/medium?v=v2&amp;amp;px=400" role="button" title="joshua_0-1579807814183.png" alt="joshua_0-1579807814183.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 19:30:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-modify-overwrite-existing-column-with-formula-in/m-p/242585#M47907</guid>
      <dc:creator>joshua</dc:creator>
      <dc:date>2020-01-23T19:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify(overwrite) existing column with formula in datatable</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-modify-overwrite-existing-column-with-formula-in/m-p/242587#M47908</link>
      <description>&lt;P&gt;Here is one way to do that:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

nameList = dt &amp;lt;&amp;lt; get column names( string );

For( i = 1, i &amp;lt;= N Items( nameList ), i++,
	If( Contains( nameList[i], "length" ),
		For Each Row( 
			as Column( nameList[i] ) = as Column( nameList[i] ) / 100 )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Jan 2020 19:40:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-modify-overwrite-existing-column-with-formula-in/m-p/242587#M47908</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-01-23T19:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify(overwrite) existing column with formula in datatable</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-modify-overwrite-existing-column-with-formula-in/m-p/242590#M47910</link>
      <description>&lt;P&gt;Check the formatting of the column. More than likely the format is not set to "Best" and you are seeing rounded values.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 20:00:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-modify-overwrite-existing-column-with-formula-in/m-p/242590#M47910</guid>
      <dc:creator>Dan_Obermiller</dc:creator>
      <dc:date>2020-01-23T20:00:16Z</dc:date>
    </item>
  </channel>
</rss>

