<?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: Calculation Result Discrepancy, Col Mean, etc. in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Calculation-Result-Discrepancy-Col-Mean-etc/m-p/927390#M108514</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Eval(Substitute(
	Expr(Col Mean(
		:data,
		:A,
		:B,
		_input1_ == _input2_
	),
	Expr(_input1_) = NameExpr(AsColumn(dt, get_input_1)),
	Expr(_input2_) = get_input_2
	)
));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but you need to add new column and formula to that example&lt;/P&gt;</description>
    <pubDate>Fri, 30 Jan 2026 09:36:19 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2026-01-30T09:36:19Z</dc:date>
    <item>
      <title>Calculation Result Discrepancy, Col Mean, etc.</title>
      <link>https://community.jmp.com/t5/Discussions/Calculation-Result-Discrepancy-Col-Mean-etc/m-p/927301#M108506</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Why do calculation results differ when using variables compared to using direct strings? I suspect that when variables are used, the grouping function for the variable part might not be working. How can this be resolved?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;with the following formula&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Col Mean(
	:data,
	:A,
	:B,
	:C_D == "ccccccc"
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;This is the formula.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Col Mean(
	:data,
	:A,
	:B,
	Column(Eval Insert("C_^get_input_1^" == get_input_2))
)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 30 Jan 2026 01:17:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Calculation-Result-Discrepancy-Col-Mean-etc/m-p/927301#M108506</guid>
      <dc:creator>TamedZebra</dc:creator>
      <dc:date>2026-01-30T01:17:54Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Result Discrepancy, Col Mean, etc.</title>
      <link>https://community.jmp.com/t5/Discussions/Calculation-Result-Discrepancy-Col-Mean-etc/m-p/927311#M108507</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Sorry, everyone. I forgot to mention that&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;get_input_1&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;and&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;get_input_2&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;can be assumed to be already obtained as strings, respectively.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jan 2026 01:22:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Calculation-Result-Discrepancy-Col-Mean-etc/m-p/927311#M108507</guid>
      <dc:creator>TamedZebra</dc:creator>
      <dc:date>2026-01-30T01:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Result Discrepancy, Col Mean, etc.</title>
      <link>https://community.jmp.com/t5/Discussions/Calculation-Result-Discrepancy-Col-Mean-etc/m-p/927324#M108508</link>
      <description>&lt;P&gt;First one is comparing column vs string and second one we cannot be sure what is being compared (string to string which would always be 1 or 0?). At least it isn't evaluated and you will need to evaluate the values into the formula&lt;/P&gt;
&lt;P&gt;&lt;LI-MESSAGE title="Insert one expression into another using Eval Insert, Eval Expr, Parse, and Substitute" uid="48998" url="https://community.jmp.com/t5/JSL-Cookbook-Archived/Insert-one-expression-into-another-using-Eval-Insert-Eval-Expr/m-p/48998#U48998" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-tkb-thread lia-fa-icon lia-fa-tkb lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jan 2026 05:29:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Calculation-Result-Discrepancy-Col-Mean-etc/m-p/927324#M108508</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2026-01-30T05:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Result Discrepancy, Col Mean, etc.</title>
      <link>https://community.jmp.com/t5/Discussions/Calculation-Result-Discrepancy-Col-Mean-etc/m-p/927364#M108513</link>
      <description>&lt;P class="[&amp;amp;:not(&amp;amp;:first-child):has(strong)]:mt-1"&gt;I want to achieve the same result as the expression in the first line. When the variables were given as get_input_1="D" and get_input_2="cccccc" respectively, I naturally expected the same result, but the reality was different...&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jan 2026 08:31:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Calculation-Result-Discrepancy-Col-Mean-etc/m-p/927364#M108513</guid>
      <dc:creator>TamedZebra</dc:creator>
      <dc:date>2026-01-30T08:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Result Discrepancy, Col Mean, etc.</title>
      <link>https://community.jmp.com/t5/Discussions/Calculation-Result-Discrepancy-Col-Mean-etc/m-p/927390#M108514</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Eval(Substitute(
	Expr(Col Mean(
		:data,
		:A,
		:B,
		_input1_ == _input2_
	),
	Expr(_input1_) = NameExpr(AsColumn(dt, get_input_1)),
	Expr(_input2_) = get_input_2
	)
));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but you need to add new column and formula to that example&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jan 2026 09:36:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Calculation-Result-Discrepancy-Col-Mean-etc/m-p/927390#M108514</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2026-01-30T09:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Result Discrepancy, Col Mean, etc.</title>
      <link>https://community.jmp.com/t5/Discussions/Calculation-Result-Discrepancy-Col-Mean-etc/m-p/927417#M108516</link>
      <description>&lt;P&gt;&lt;STRIKE&gt;Column(Eval Insert("C_^get_input_1^" == get_input_2)) evaluates to&amp;nbsp;Column( "C_D" == "ccccccc" ), so your formula would be&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;edit&lt;/P&gt;
&lt;P&gt;Including non-string inside Eval Insert() actually causes it to evaluate to the empty string.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Col Mean(
	:data,
	:A,
	:B,
	Column( "" )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That may be why it isn't working as expected.&amp;nbsp; Jarmo's solution should be what you want.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jan 2026 12:56:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Calculation-Result-Discrepancy-Col-Mean-etc/m-p/927417#M108516</guid>
      <dc:creator>mmarchandFSLR</dc:creator>
      <dc:date>2026-01-30T12:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Result Discrepancy, Col Mean, etc.</title>
      <link>https://community.jmp.com/t5/Discussions/Calculation-Result-Discrepancy-Col-Mean-etc/m-p/928299#M108546</link>
      <description>&lt;DIV class="rounded-lg p-4 shadow-md bg-background text-foreground whitespace-pre-wrap text-sm max-w-[calc(100%_-_5rem)] mr-auto relative [&amp;amp;:hover&amp;gt;button]:opacity-100"&gt;
&lt;DIV class="reset flex flex-col gap-1 markdown"&gt;
&lt;P class="[&amp;amp;:not(&amp;amp;:first-child):has(strong)]:mt-1"&gt;Thank you for your replies. Also, I apologize for my late responses.&lt;/P&gt;
&lt;P class="[&amp;amp;:not(&amp;amp;:first-child):has(strong)]:mt-1"&gt;I wrote the JSL as shown below, but an error is being output. What could be the cause?&lt;/P&gt;
&lt;P class="[&amp;amp;:not(&amp;amp;:first-child):has(strong)]:mt-1"&gt;The error message says "insufficient arguments" at the location "Substitute/&lt;EM&gt;###&lt;/EM&gt;/(Expr(".&lt;/P&gt;
&lt;/DIV&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;	Data Table( "data_table" ) &amp;lt;&amp;lt; New Column( Eval Insert("Xbar_^get_input_process^_^get_input_line^"),
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Formula(
			Eval(Substitute(
				Expr(Col Mean(
					:data,
					:A,
					:B,
					_input1_ == _input2_
					),
					Expr(_input1_) = NameExpr(AsColumn(dt, Eval Insert("new_^get_input_1^"))),
					Expr(_input2_) = get_input_2
					)
					));
	)) &amp;lt;&amp;lt; Run Formulas;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 02 Feb 2026 00:29:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Calculation-Result-Discrepancy-Col-Mean-etc/m-p/928299#M108546</guid>
      <dc:creator>TamedZebra</dc:creator>
      <dc:date>2026-02-02T00:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Result Discrepancy, Col Mean, etc.</title>
      <link>https://community.jmp.com/t5/Discussions/Calculation-Result-Discrepancy-Col-Mean-etc/m-p/928327#M108549</link>
      <description>&lt;P&gt;&lt;LI-MESSAGE title="Insert one expression into another using Eval Insert, Eval Expr, Parse, and Substitute" uid="48998" url="https://community.jmp.com/t5/JSL-Cookbook-Archived/Insert-one-expression-into-another-using-Eval-Insert-Eval-Expr/m-p/48998#U48998" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-tkb-thread lia-fa-icon lia-fa-tkb lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Most likely something like this, but I cannot test it as I don't have data or the earlier part of the script&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);


dt = Data Table("data_table");

Eval(Substitute(
	Expr(Data Table("data_table") &amp;lt;&amp;lt; New Column(colname,
		Numeric,
		"Continuous",
		Formula(Col Mean(:data, :A, :B, _input1_ == _input2_)),
	)),
	Expr(colname), Substitute(Xbar_^get_input_process^_^get_input_line^),
	Expr(_input1_) = NameExpr(AsColumn(dt, Eval Insert("new_^get_input_1^"))),
	Expr(_input2_) = get_input_2
));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Feb 2026 05:50:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Calculation-Result-Discrepancy-Col-Mean-etc/m-p/928327#M108549</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2026-02-02T05:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Result Discrepancy, Col Mean, etc.</title>
      <link>https://community.jmp.com/t5/Discussions/Calculation-Result-Discrepancy-Col-Mean-etc/m-p/928355#M108554</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;Thank you for your consideration, even though it was difficult to experiment without being able to provide actual data.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="relative overflow-hidden h-full w-full" dir="ltr"&gt;
&lt;DIV class="h-full w-full [&amp;amp;&amp;gt;div]:!block" data-radix-scroll-area-viewport=""&gt;
&lt;DIV&gt;
&lt;DIV class="flex w-[94%] mx-auto"&gt;
&lt;DIV class="h-full w-full"&gt;
&lt;DIV class="w-full flex flex-col gap-4 p-2"&gt;
&lt;DIV class="rounded-lg p-4 shadow-md bg-background text-foreground whitespace-pre-wrap text-sm max-w-[calc(100%_-_5rem)] mr-auto relative [&amp;amp;:hover&amp;gt;button]:opacity-100"&gt;
&lt;DIV class="reset flex flex-col gap-1 markdown"&gt;
&lt;P class="[&amp;amp;:not(&amp;amp;:first-child):has(strong)]:mt-1"&gt;I modified it as follows to fit my data table.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);


dt = Data Table("data_table");

Eval(Substitute(
	Expr(Data Table("data_table") &amp;lt;&amp;lt; New Column(colname,
		Numeric,
		"Continuous",
		Formula(Col Mean(:data, :A, :B, _input1_ == _input2_)),
	)),
	Expr(colname), Eval Insert(Xbar_^get_input_process^_^get_input_line^),
	Expr(_input1_) , NameExpr(AsColumn(dt, Eval Insert("new_^get_input_1^"))),
	Expr(_input2_) , get_input_2
));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="mt-4 w-full flex justify-center"&gt;
&lt;DIV class="w-[94%]"&gt;
&lt;DIV class="mt-4"&gt;
&lt;DIV class="relative"&gt;
&lt;DIV class="absolute left-4 -top-6 z-10"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV class="relative flex items-center bg-background pl-4 pr-3 py-2 rounded-[28px] shadow-md flex-wrap ease-in duration-100 border-dashed border-4 border-transparent"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 02 Feb 2026 08:15:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Calculation-Result-Discrepancy-Col-Mean-etc/m-p/928355#M108554</guid>
      <dc:creator>TamedZebra</dc:creator>
      <dc:date>2026-02-02T08:15:34Z</dc:date>
    </item>
  </channel>
</rss>

