<?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: Formula Column from variable list using jsl parse, eval insert, expr and substitute in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Formula-Column-from-variable-list-using-jsl-parse-eval-insert/m-p/17842#M16267</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nice collection of different methods.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lately I have come to prefer working with expressions rather than strings in cases like this. For setting a formula by JSL I first build the expression using EvalExpr(), which I then insert with NameExpr() to avoid evaluation at runtime. &lt;/P&gt;&lt;P&gt;Below are two examples based on either a list of column names or a list of strings, the latter is a little more challenging. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier; color: #942193;"&gt;&lt;SPAN style="color: #000000;"&gt;dt &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #032ce4;"&gt;Open&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;"$SAMPLE_DATA/Big Class.jmp"&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier; min-height: 13px;"&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier; color: #008f00;"&gt;// 1. List of column names&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier; color: #008f00;"&gt;&lt;SPAN style="color: #000000;"&gt;L1 &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;STRONG&gt;{&lt;/STRONG&gt;age&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; height&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; weight&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;// i.e dt&amp;lt;&amp;lt;get column names(numeric);&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier; color: #032ce4;"&gt;&lt;SPAN style="color: #000000;"&gt;form1 &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;Eval Expr&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;Mean&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;Expr&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;L1&lt;STRONG&gt;)))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;form1col &lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt; dt &lt;SPAN style="color: #011993;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;New Column&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #032ce4;"&gt;Concat Items&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #032ce4;"&gt;Words&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #032ce4;"&gt;Char&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;L1&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: #942193;"&gt;"{},"&lt;/SPAN&gt;&lt;STRONG&gt;))&lt;/STRONG&gt; &lt;SPAN style="color: #011993;"&gt;||&lt;/SPAN&gt; &lt;SPAN style="color: #942193;"&gt;" Average"&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; formula&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #032ce4;"&gt;Name Expr&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;form1&lt;STRONG&gt;)))&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier; min-height: 13px;"&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier; color: #008f00;"&gt;// 2. List of strings&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier; color: #008f00;"&gt;&lt;SPAN style="color: #000000;"&gt;L2 &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #942193;"&gt;"age"&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #942193;"&gt;"height"&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #942193;"&gt;"weight"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;// i.e dt&amp;lt;&amp;lt;get column names(numeric, string);&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier; min-height: 13px;"&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier; color: #032ce4;"&gt;&lt;SPAN style="color: #000000;"&gt;form2 &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;Eval Expr&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #032ce4;"&gt;Mean&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #032ce4;"&gt;Expr&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #032ce4;"&gt;Repeat&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i &lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;{&lt;/STRONG&gt;i&lt;SPAN style="color: #011993;"&gt;++&lt;/SPAN&gt; &lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt; &lt;SPAN style="color: #032ce4;"&gt;Eval Expr&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #032ce4;"&gt;As Column&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #032ce4;"&gt;Expr&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;L2&lt;STRONG&gt;[&lt;/STRONG&gt;i&lt;STRONG&gt;])))}&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #032ce4;"&gt;N Items&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;L2&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;form2col &lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt; dt &lt;SPAN style="color: #011993;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;New Column&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #032ce4;"&gt;Concat Items&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;L2&lt;STRONG&gt;)&lt;/STRONG&gt; &lt;SPAN style="color: #011993;"&gt;||&lt;/SPAN&gt; &lt;SPAN style="color: #942193;"&gt;" Average"&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; formula&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #032ce4;"&gt;Name Expr&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;form2&lt;STRONG&gt;)))&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Apr 2016 22:57:19 GMT</pubDate>
    <dc:creator>ms</dc:creator>
    <dc:date>2016-04-06T22:57:19Z</dc:date>
    <item>
      <title>Formula Column from variable list using jsl parse, eval insert, expr and substitute</title>
      <link>https://community.jmp.com/t5/Discussions/Formula-Column-from-variable-list-using-jsl-parse-eval-insert/m-p/17841#M16266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I use 2 methods to create formula columns depending on whether I know how many variables the formula needs&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Expr and substitute are easy to read. Section 1 in the code creates several&amp;nbsp; formula columns for each variable in a list for mean(&lt;EM&gt;var, byvar&lt;/EM&gt;)&lt;/LI&gt;&lt;LI&gt;Parse and eval and possibly eval insert create a single formula column that requires a number of variables, the number and name being set by the variable list.&lt;OL&gt;&lt;LI&gt;Section 2a and 2b work and are functionally equivalent&lt;/LI&gt;&lt;LI&gt;Section 2c and 2d do not run, but seem a path to an elegant solution&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I would like ideas to create better practices and would appreciate recommendations&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;Names Default To Here( 1 );&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;n=ntable();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;dtnms={};&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;If(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt; n==0, dtc=1,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt; n==1, If(current data table() &amp;lt;&amp;lt; get name == "Big Class", dtc=0, dtc=1) , // else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt; for(ii=1, ii &amp;lt;= n, ii++, insert into(dtnms, data table(ii) &amp;lt;&amp;lt; getname));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt; if(contains(dtnms, "Big Class") &amp;gt; 0, dtc=1, dtc=0);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;if (dtc,dt = Open( "$SAMPLE_DATA/Big Class.jmp" ), dt = data table("Big Class"));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;// Section 1: Add several columns of formula entering variables dynamically.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;Form1=expr(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt; form1col=dt &amp;lt;&amp;lt; new column(Name, formula(col mean(As Column(YVar), As Column(ByVar))))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;VarList={"sex", "height", "weight"};&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;For(ii=2, ii &amp;lt;= N Items(VarList), ii++,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt; Eval(Substitute(Name expr(form1),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;&amp;nbsp; expr(Name), VarList[ii]||" Averages",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;&amp;nbsp; expr(YVar), VarList[ii],&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;&amp;nbsp; expr(ByVar), VarList[1], &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt; ));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;// Section 2: Average the columns in the list of variables&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;// Method 2a Method works but is hard to debug&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;VarList={"height", "weight", "age"};&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;Formtxt1 = "formcol = dt &amp;lt;&amp;lt; new column(\!"Method a: Mean\!", formula(mean( ";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;Formtxt2 = "As Column(\!""||VarList[1]||"\!")";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;If(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt; N Items(VarList)==2, Formtxt2 ||= ", As Column(\!""||VarList[2]||"\!")",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt; N Items(VarList)&amp;gt;2, For(ii=2, ii &amp;lt;= N Items(VarList), ii++,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; Formtxt2 ||= ", As Column(\!""||VarList[ii]||"\!")"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;&amp;nbsp; )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;Formtxt=Formtxt1||Formtxt2||");";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;eval(parse(Formtxt));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;// Method 2b: Somewhat easier to see&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;col4=expr(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;&amp;nbsp; NewCol1=dt &amp;lt;&amp;lt; New Column("Method b: Mean of "||_names_);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;form4txt="NewCol1 &amp;lt;&amp;lt;formula(Mean( ^_Vars_^&amp;nbsp; )))";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;VarList={"height", "weight", "age"};&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;VarRef = eval list(dt &amp;lt;&amp;lt; get Column Reference(VarList));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;_Vars_ = "As Column( \!"" || ConCat Items(VarList, "\!"), As Column( \!"") || "\!")";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;form4txta = Eval Insert(form4txt);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;Eval(Substitute(Name expr(col4),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt; expr(_names_), concat Items(VarList,", ",)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;Eval(Parse(form4txta)); //Parse makes the text an expr which is evaluated&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;// *************************************** //&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;// ************* Not working ************* //&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;//Method 2c: I think this would be the best, but I cannot make it correct - Still have a list &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;form3=expr(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;&amp;nbsp; NewCol=dt &amp;lt;&amp;lt; New Column("Mean of "||_names_, formula(Mean(_Vars_ )));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;VarList={"height", "weight", "age"};&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;VarRef = eval list(dt &amp;lt;&amp;lt; get Column Reference(VarList));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;Eval(Substitute(Name expr(form3),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt; expr(_names_), concat Items(VarList,", ",),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt; expr(_Vars_), VarRef&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;// Method 2d: Using a loop, but still incorrect&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;form4=expr(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;&amp;nbsp; NewCol=dt &amp;lt;&amp;lt; New Column("Mean of "||_names_, formula(Mean(_Vars_ )));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;VarList={"height", "weight", "age"};&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;VarRef = eval list(dt &amp;lt;&amp;lt; get Column Reference(VarList));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;Form4a =Substitute(Name expr(form4),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt; expr(_names_), concat Items(VarList,", ",)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;For(ii=1, ii &amp;lt;= N Items(VarList), ii++,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt; form4a=Substitute(Name expr(form4a),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;&amp;nbsp; expr(_Vars_), expr(VarRef[ii], _Vars_)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt; );&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;Eval(Substitute(Name expr(form4a),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt; expr(_Vars_), ""&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;// *************************************** //&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;// ************* Not working ************* //&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2016 21:00:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Formula-Column-from-variable-list-using-jsl-parse-eval-insert/m-p/17841#M16266</guid>
      <dc:creator>tony_cooper1</dc:creator>
      <dc:date>2016-04-06T21:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: Formula Column from variable list using jsl parse, eval insert, expr and substitute</title>
      <link>https://community.jmp.com/t5/Discussions/Formula-Column-from-variable-list-using-jsl-parse-eval-insert/m-p/17842#M16267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nice collection of different methods.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lately I have come to prefer working with expressions rather than strings in cases like this. For setting a formula by JSL I first build the expression using EvalExpr(), which I then insert with NameExpr() to avoid evaluation at runtime. &lt;/P&gt;&lt;P&gt;Below are two examples based on either a list of column names or a list of strings, the latter is a little more challenging. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier; color: #942193;"&gt;&lt;SPAN style="color: #000000;"&gt;dt &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #032ce4;"&gt;Open&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;"$SAMPLE_DATA/Big Class.jmp"&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier; min-height: 13px;"&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier; color: #008f00;"&gt;// 1. List of column names&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier; color: #008f00;"&gt;&lt;SPAN style="color: #000000;"&gt;L1 &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;STRONG&gt;{&lt;/STRONG&gt;age&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; height&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; weight&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;// i.e dt&amp;lt;&amp;lt;get column names(numeric);&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier; color: #032ce4;"&gt;&lt;SPAN style="color: #000000;"&gt;form1 &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;Eval Expr&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;Mean&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;Expr&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;L1&lt;STRONG&gt;)))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;form1col &lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt; dt &lt;SPAN style="color: #011993;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;New Column&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #032ce4;"&gt;Concat Items&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #032ce4;"&gt;Words&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #032ce4;"&gt;Char&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;L1&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: #942193;"&gt;"{},"&lt;/SPAN&gt;&lt;STRONG&gt;))&lt;/STRONG&gt; &lt;SPAN style="color: #011993;"&gt;||&lt;/SPAN&gt; &lt;SPAN style="color: #942193;"&gt;" Average"&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; formula&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #032ce4;"&gt;Name Expr&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;form1&lt;STRONG&gt;)))&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier; min-height: 13px;"&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier; color: #008f00;"&gt;// 2. List of strings&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier; color: #008f00;"&gt;&lt;SPAN style="color: #000000;"&gt;L2 &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #942193;"&gt;"age"&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #942193;"&gt;"height"&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #942193;"&gt;"weight"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;// i.e dt&amp;lt;&amp;lt;get column names(numeric, string);&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier; min-height: 13px;"&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier; color: #032ce4;"&gt;&lt;SPAN style="color: #000000;"&gt;form2 &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;Eval Expr&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #032ce4;"&gt;Mean&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #032ce4;"&gt;Expr&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #032ce4;"&gt;Repeat&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i &lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;{&lt;/STRONG&gt;i&lt;SPAN style="color: #011993;"&gt;++&lt;/SPAN&gt; &lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt; &lt;SPAN style="color: #032ce4;"&gt;Eval Expr&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #032ce4;"&gt;As Column&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #032ce4;"&gt;Expr&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;L2&lt;STRONG&gt;[&lt;/STRONG&gt;i&lt;STRONG&gt;])))}&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #032ce4;"&gt;N Items&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;L2&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;form2col &lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt; dt &lt;SPAN style="color: #011993;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;New Column&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #032ce4;"&gt;Concat Items&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;L2&lt;STRONG&gt;)&lt;/STRONG&gt; &lt;SPAN style="color: #011993;"&gt;||&lt;/SPAN&gt; &lt;SPAN style="color: #942193;"&gt;" Average"&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; formula&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #032ce4;"&gt;Name Expr&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;form2&lt;STRONG&gt;)))&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2016 22:57:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Formula-Column-from-variable-list-using-jsl-parse-eval-insert/m-p/17842#M16267</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2016-04-06T22:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: Formula Column from variable list using jsl parse, eval insert, expr and substitute</title>
      <link>https://community.jmp.com/t5/Discussions/Formula-Column-from-variable-list-using-jsl-parse-eval-insert/m-p/17843#M16268</link>
      <description>&lt;P&gt;Much appreciated. Also helped me search the discussions and I saw&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.jmp.com/message/216568#216568" target="_blank"&gt;Script Issue: Variable Names Not Passed Dynamically to Conditional Evaluation Statements&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.jmp.com/message/227614#227614" target="_blank"&gt;Using a FOR loop in Formula to create a new column&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2024 20:42:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Formula-Column-from-variable-list-using-jsl-parse-eval-insert/m-p/17843#M16268</guid>
      <dc:creator>tony_cooper1</dc:creator>
      <dc:date>2024-01-03T20:42:59Z</dc:date>
    </item>
  </channel>
</rss>

