<?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: A question for  &amp;quot;(Eval(Eval Expr(Sum(Expr(sumCol))))== N Items(sumCol)=&amp;gt; 1&amp;quot; statement. in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/A-question-for-quot-Eval-Eval-Expr-Sum-Expr-sumCol-N-Items/m-p/412582#M66217</link>
    <description>&lt;P&gt;Do you have any idea what you're actually trying to do?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My guess is you have a script making that and people tried to put in the variable `sumCol` into the formula.&amp;nbsp; with something like&amp;nbsp;&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");
sumCol = dt:weight &amp;lt;&amp;lt; Get Values();
dt &amp;lt;&amp;lt; New Column("test", Formula(if(Eval(EvalExpr(Sum(Expr(sumCol))))==Nitems(sumCol), 1, 0)));

// What I think you'd want to do is 

Eval(EvalExpr(
	dt &amp;lt;&amp;lt; New Column("Test 2", Formula(Sum(Expr(sumCol)) ==Nitems(Expr(sumCol))));
	// or
	dt &amp;lt;&amp;lt; New Column("Test 3", Formula(
		fsumCol = Expr(sumCol);// this is just letting the formula know what it is
		Sum(fsumCol) == Nitems(fsumCol);
	));
));
// you don't need the if, 1, 0 because you're boolean will eval to 1 anyway. &lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 25 Aug 2021 16:08:22 GMT</pubDate>
    <dc:creator>vince_faller</dc:creator>
    <dc:date>2021-08-25T16:08:22Z</dc:date>
    <item>
      <title>A question for  "(Eval(Eval Expr(Sum(Expr(sumCol))))== N Items(sumCol)=&gt; 1" statement.</title>
      <link>https://community.jmp.com/t5/Discussions/A-question-for-quot-Eval-Eval-Expr-Sum-Expr-sumCol-N-Items/m-p/412549#M66212</link>
      <description>&lt;P&gt;Dear Sir,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am debugging an if statement like the one below.&amp;nbsp; I am wondering what does it evaluate on and if it would generate "1" from the unknown state of "(Eval(Eval Expr(Sum(Expr(sumCol))))== N Items(sumCol)"&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="johnj_wang1_0-1629904172990.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/35316i84E7C727314B3999/image-size/medium?v=v2&amp;amp;px=400" role="button" title="johnj_wang1_0-1629904172990.png" alt="johnj_wang1_0-1629904172990.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Please let me know.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 19:55:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/A-question-for-quot-Eval-Eval-Expr-Sum-Expr-sumCol-N-Items/m-p/412549#M66212</guid>
      <dc:creator>johnj_wang1</dc:creator>
      <dc:date>2023-06-09T19:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: A question for  "(Eval(Eval Expr(Sum(Expr(sumCol))))== N Items(sumCol)=&gt; 1" statement.</title>
      <link>https://community.jmp.com/t5/Discussions/A-question-for-quot-Eval-Eval-Expr-Sum-Expr-sumCol-N-Items/m-p/412564#M66213</link>
      <description>&lt;P&gt;Strong suggestion to check out this great post about &lt;A href="https://community.jmp.com/t5/JSL-Cookbook/Insert-one-expression-into-another-using-Eval-Insert-Eval-Expr/ta-p/48998" target="_blank" rel="noopener"&gt;Insert one expression into another using Eval Insert, Eval Expr, Parse, and Substitute&lt;/A&gt; .&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);

sumCol = [1,1,1]; 
//check in parts
Show(Eval Expr(Sum(Expr(sumCol))));
Show(Eval(Eval Expr(Sum(Expr(sumCol)))));
Show(N Items(sumCol));
Show(If(Eval(Eval Expr(Sum(Expr(sumCol))))== N Items(sumCol),1,0));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 15:33:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/A-question-for-quot-Eval-Eval-Expr-Sum-Expr-sumCol-N-Items/m-p/412564#M66213</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-08-25T15:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: A question for  "(Eval(Eval Expr(Sum(Expr(sumCol))))== N Items(sumCol)=&gt; 1" statement.</title>
      <link>https://community.jmp.com/t5/Discussions/A-question-for-quot-Eval-Eval-Expr-Sum-Expr-sumCol-N-Items/m-p/412582#M66217</link>
      <description>&lt;P&gt;Do you have any idea what you're actually trying to do?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My guess is you have a script making that and people tried to put in the variable `sumCol` into the formula.&amp;nbsp; with something like&amp;nbsp;&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");
sumCol = dt:weight &amp;lt;&amp;lt; Get Values();
dt &amp;lt;&amp;lt; New Column("test", Formula(if(Eval(EvalExpr(Sum(Expr(sumCol))))==Nitems(sumCol), 1, 0)));

// What I think you'd want to do is 

Eval(EvalExpr(
	dt &amp;lt;&amp;lt; New Column("Test 2", Formula(Sum(Expr(sumCol)) ==Nitems(Expr(sumCol))));
	// or
	dt &amp;lt;&amp;lt; New Column("Test 3", Formula(
		fsumCol = Expr(sumCol);// this is just letting the formula know what it is
		Sum(fsumCol) == Nitems(fsumCol);
	));
));
// you don't need the if, 1, 0 because you're boolean will eval to 1 anyway. &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Aug 2021 16:08:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/A-question-for-quot-Eval-Eval-Expr-Sum-Expr-sumCol-N-Items/m-p/412582#M66217</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2021-08-25T16:08:22Z</dc:date>
    </item>
  </channel>
</rss>

