<?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 do I manipulate column formulae in data tables by scripting? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-manipulate-column-formulae-in-data-tables-by-scripting/m-p/527663#M75145</link>
    <description>&lt;P&gt;Your specified formula is recursive when used as a column formula.&amp;nbsp; A column formula will run whenever it detects a change in the column.&lt;/P&gt;
&lt;P&gt;What you are suggesting can simply be done in open JSL.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
Open( "$SAMPLE_DATA/Big Class.jmp" );
Current Data Table() &amp;lt;&amp;lt; Get Column Names;
height = height/2;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
Open( "$SAMPLE_DATA/Big Class.jmp" );
For( i = 1, i &amp;lt;= N Rows( current data table() ), i++,
	:height[i] = :height[i] / 2
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt:Height &amp;lt;&amp;lt; set values( dt[0, 4] / 2 );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If the formula isn't recursive, one can set the column formula by using the Set Formula message&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
Open( "$SAMPLE_DATA/Big Class.jmp" );
Current Data Table() &amp;lt;&amp;lt; Get Column Names;
:height &amp;lt;&amp;lt; set formula(:weight/2);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I strongly suggest that you take the time to read the Scripting Guide available in the JMP Documentation Library under the Help pull down menu&lt;/P&gt;</description>
    <pubDate>Thu, 28 Jul 2022 13:45:14 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2022-07-28T13:45:14Z</dc:date>
    <item>
      <title>How do I manipulate column formulae in data tables by scripting?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-manipulate-column-formulae-in-data-tables-by-scripting/m-p/527624#M75140</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to add a formula to convert values in a selected column through scripting without having to add any new columns in the data table, is there a way to edit formulas for a column by scripting? For example I'm trying to set the height column in this data table to be halved when I run the script:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
Open( "$SAMPLE_DATA/Big Class.jmp" );
Current Data Table() &amp;lt;&amp;lt; Get Column Names;
height = height/2;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:52:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-manipulate-column-formulae-in-data-tables-by-scripting/m-p/527624#M75140</guid>
      <dc:creator>PowerOx327</dc:creator>
      <dc:date>2023-06-10T23:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do I manipulate column formulae in data tables by scripting?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-manipulate-column-formulae-in-data-tables-by-scripting/m-p/527660#M75144</link>
      <description>&lt;P&gt;A data column formula is just a JSL expression that is evaluated row-wise. You can use the data column messages &amp;lt;&amp;lt; Get Formula() and &amp;lt;&amp;lt; Set Formula(). Use expression functions to access and modify the expressions as needed.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 13:17:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-manipulate-column-formulae-in-data-tables-by-scripting/m-p/527660#M75144</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2022-07-28T13:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do I manipulate column formulae in data tables by scripting?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-manipulate-column-formulae-in-data-tables-by-scripting/m-p/527663#M75145</link>
      <description>&lt;P&gt;Your specified formula is recursive when used as a column formula.&amp;nbsp; A column formula will run whenever it detects a change in the column.&lt;/P&gt;
&lt;P&gt;What you are suggesting can simply be done in open JSL.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
Open( "$SAMPLE_DATA/Big Class.jmp" );
Current Data Table() &amp;lt;&amp;lt; Get Column Names;
height = height/2;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
Open( "$SAMPLE_DATA/Big Class.jmp" );
For( i = 1, i &amp;lt;= N Rows( current data table() ), i++,
	:height[i] = :height[i] / 2
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt:Height &amp;lt;&amp;lt; set values( dt[0, 4] / 2 );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If the formula isn't recursive, one can set the column formula by using the Set Formula message&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
Open( "$SAMPLE_DATA/Big Class.jmp" );
Current Data Table() &amp;lt;&amp;lt; Get Column Names;
:height &amp;lt;&amp;lt; set formula(:weight/2);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I strongly suggest that you take the time to read the Scripting Guide available in the JMP Documentation Library under the Help pull down menu&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 13:45:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-manipulate-column-formulae-in-data-tables-by-scripting/m-p/527663#M75145</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-07-28T13:45:14Z</dc:date>
    </item>
  </channel>
</rss>

