<?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 use JSL to extract formula text from a column and save it to a cell? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-extract-formula-text-from-a-column-and-save-it/m-p/403392#M65399</link>
    <description>&lt;P&gt;You can get the formula with &amp;lt;&amp;lt; Get Formula then change that to character and do required modifications&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);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt &amp;lt;&amp;lt; New Column("test", Formula(If(:age &amp;gt; 15, :height + 50 + :weight, :height + 100 + :weight)));

dt &amp;lt;&amp;lt; New Column("txt", Character, "Nominal", &amp;lt;&amp;lt; Set Each Value(
	Substitute(Char(AsColumn(:test) &amp;lt;&amp;lt; get formula), " ", "")
));&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 23 Jul 2021 11:02:51 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2021-07-23T11:02:51Z</dc:date>
    <item>
      <title>How to use JSL to extract formula text from a column and save it to a cell?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-extract-formula-text-from-a-column-and-save-it/m-p/403379#M65396</link>
      <description>&lt;P&gt;For example, add a "test" column with "Big Class.jmp" and write a random formula.How do use JSL to save the formula extract formula text in this column to a cell in another column?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Column( "test" );
Column( "test" ) &amp;lt;&amp;lt; Formula( If( age &amp;gt; 15, height + 50 + weight, height + 100 + weight ) );
dt &amp;lt;&amp;lt; run formulas;


New Column( "txt", Character, "Nominal" );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-07-23_1827.png" style="width: 765px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/34475i9527C208920EE1BF/image-size/large?v=v2&amp;amp;px=999" role="button" title="2021-07-23_1827.png" alt="2021-07-23_1827.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 19:53:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-extract-formula-text-from-a-column-and-save-it/m-p/403379#M65396</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2023-06-09T19:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to use JSL to extract formula text from a column and save it to a cell?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-extract-formula-text-from-a-column-and-save-it/m-p/403386#M65397</link>
      <description>&lt;P&gt;And I want to use JSL to achieve the formula to remove the newline character, but also to remove redundant space.Makes the formula text content stored in the cell simpler.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dt[1,"txt"]=&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If(:age&amp;gt;15,:height+50+:weight,:height+100+:weight)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks Experts!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 10:42:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-extract-formula-text-from-a-column-and-save-it/m-p/403386#M65397</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2021-07-23T10:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to use JSL to extract formula text from a column and save it to a cell?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-extract-formula-text-from-a-column-and-save-it/m-p/403392#M65399</link>
      <description>&lt;P&gt;You can get the formula with &amp;lt;&amp;lt; Get Formula then change that to character and do required modifications&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);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt &amp;lt;&amp;lt; New Column("test", Formula(If(:age &amp;gt; 15, :height + 50 + :weight, :height + 100 + :weight)));

dt &amp;lt;&amp;lt; New Column("txt", Character, "Nominal", &amp;lt;&amp;lt; Set Each Value(
	Substitute(Char(AsColumn(:test) &amp;lt;&amp;lt; get formula), " ", "")
));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Jul 2021 11:02:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-extract-formula-text-from-a-column-and-save-it/m-p/403392#M65399</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-07-23T11:02:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to use JSL to extract formula text from a column and save it to a cell?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-extract-formula-text-from-a-column-and-save-it/m-p/403401#M65400</link>
      <description>&lt;P&gt;See &amp;lt;&amp;lt; get formula to retrieve the formula.&lt;/P&gt;
&lt;P&gt;See Word() to retrieve the blank delimited elements to build a "blank removed" version of the formula or it can be done with a Regular Expression&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 11:30:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-extract-formula-text-from-a-column-and-save-it/m-p/403401#M65400</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-07-23T11:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to use JSL to extract formula text from a column and save it to a cell?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-extract-formula-text-from-a-column-and-save-it/m-p/403405#M65401</link>
      <description>&lt;P&gt;&lt;SPAN&gt;done with a Regular Expression&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-07-23_1941.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/34476i4DA2813F9D0B6EC8/image-size/large?v=v2&amp;amp;px=999" role="button" title="2021-07-23_1941.png" alt="2021-07-23_1941.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 11:44:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-extract-formula-text-from-a-column-and-save-it/m-p/403405#M65401</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2021-07-23T11:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to use JSL to extract formula text from a column and save it to a cell?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-extract-formula-text-from-a-column-and-save-it/m-p/403406#M65402</link>
      <description>&lt;P&gt;The prediction formula derived from xGBoost training is too complex.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to apply this prediction formula to new data is really complicated.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 11:47:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-extract-formula-text-from-a-column-and-save-it/m-p/403406#M65402</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2021-07-23T11:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to use JSL to extract formula text from a column and save it to a cell?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-extract-formula-text-from-a-column-and-save-it/m-p/403410#M65403</link>
      <description>&lt;P&gt;It depends on what the ultimate intention is here, but it might be more straightforward to persist the formula in cell of an &lt;A href="https://community.jmp.com/t5/Uncharted/JMP-12-Expression-Column/ba-p/21089" target="_self"&gt;expression column&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 12:20:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-extract-formula-text-from-a-column-and-save-it/m-p/403410#M65403</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2021-07-23T12:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to use JSL to extract formula text from a column and save it to a cell?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-extract-formula-text-from-a-column-and-save-it/m-p/403425#M65405</link>
      <description>&lt;P&gt;Yes, my use is to train the pattern once, get the prediction formula, and directly save the formula in text form in the cell.&lt;BR /&gt;When used for new data analysis, use the following form directly to calculate the new data using the original prediction formula&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;aaa = dt[1, "txt"];

Current Data Table( d2 );
Eval( Parse( "Column(d2,\!"test\!")&amp;lt;&amp;lt;Formula(" || aaa || ")" ) );
d2 &amp;lt;&amp;lt; run formulas;
Column( "test" ) &amp;lt;&amp;lt; deleteFormula;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 13:43:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-extract-formula-text-from-a-column-and-save-it/m-p/403425#M65405</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2021-07-23T13:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to use JSL to extract formula text from a column and save it to a cell?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-extract-formula-text-from-a-column-and-save-it/m-p/403428#M65406</link>
      <description>&lt;P&gt;I'm still unfamiliar with using JSL for regular processing,&lt;BR /&gt;Again, this is done with the EmEditor.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;document.selection.Replace("([a-Z]) ([a-Z])","\\1zzzz\\2",eeReplaceAll | eeFindReplaceRegExp,eeExFindSeparateCRLF);
document.selection.Replace(" ","",eeReplaceAll | eeFindReplaceRegExp,eeExFindSeparateCRLF);
document.selection.Replace("zzzz"," ",eeReplaceAll | eeFindReplaceRegExp,eeExFindSeparateCRLF);
document.selection.Replace("Is Missing\\(:(.[^)]{0,})\\)\\|","",eeReplaceAll | eeFindReplaceRegExp,eeExFindSeparateCRLF);
document.selection.Replace("!Is Missing\\(:(.[^)]{0,})\\)&amp;amp;","",eeReplaceAll | eeFindReplaceRegExp,eeExFindSeparateCRLF);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Jul 2021 13:48:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-extract-formula-text-from-a-column-and-save-it/m-p/403428#M65406</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2021-07-23T13:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to use JSL to extract formula text from a column and save it to a cell?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-extract-formula-text-from-a-column-and-save-it/m-p/403431#M65407</link>
      <description>&lt;P&gt;Since there are no missing values in the actual data, all of the following forms of code can be removed.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;!Is Missing(:abc) &amp;amp;
Is Missing(:abb) |&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;How should this be coded in JSL?Thanks Experts!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 14:06:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-extract-formula-text-from-a-column-and-save-it/m-p/403431#M65407</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2021-07-23T14:06:31Z</dc:date>
    </item>
  </channel>
</rss>

