<?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 Rowwise conditonal calculation in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Rowwise-conditonal-calculation/m-p/696642#M88187</link>
    <description>&lt;P&gt;I have a table of data with three columns of process data and one column with quality data. I would like to calculate a value (in new columns -each for one of the process parameters) if the process value between two rows are changing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So first of all I need JMP to look at each row and then determine whether each of the process variables are changed (if function??).&lt;/P&gt;&lt;P&gt;If changes have occurred then calculate (quality(1)-quality(2))/(process value(1)-process value(2))&lt;/P&gt;</description>
    <pubDate>Fri, 10 Nov 2023 13:04:34 GMT</pubDate>
    <dc:creator>AAYH</dc:creator>
    <dc:date>2023-11-10T13:04:34Z</dc:date>
    <item>
      <title>Rowwise conditonal calculation</title>
      <link>https://community.jmp.com/t5/Discussions/Rowwise-conditonal-calculation/m-p/696642#M88187</link>
      <description>&lt;P&gt;I have a table of data with three columns of process data and one column with quality data. I would like to calculate a value (in new columns -each for one of the process parameters) if the process value between two rows are changing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So first of all I need JMP to look at each row and then determine whether each of the process variables are changed (if function??).&lt;/P&gt;&lt;P&gt;If changes have occurred then calculate (quality(1)-quality(2))/(process value(1)-process value(2))&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 13:04:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Rowwise-conditonal-calculation/m-p/696642#M88187</guid>
      <dc:creator>AAYH</dc:creator>
      <dc:date>2023-11-10T13:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: Rowwise conditonal calculation</title>
      <link>https://community.jmp.com/t5/Discussions/Rowwise-conditonal-calculation/m-p/696650#M88188</link>
      <description>&lt;P&gt;You can calculate difference between rows using &lt;A href="https://www.jmp.com/support/help/en/17.2/#page/jmp/row-functions-2.shtml?os=win&amp;amp;source=application#ww4976282" target="_blank" rel="noopener"&gt;Dif()&lt;/A&gt; or &lt;A href="https://www.jmp.com/support/help/en/17.2/#page/jmp/row-functions-2.shtml?os=win&amp;amp;source=application#ww2736368" target="_blank" rel="noopener"&gt;Lag()&lt;/A&gt;.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = New Table("Untitled 2",
	Add Rows(3),
	Compress File When Saved(1),
	New Column("P", Numeric, "Continuous", Format("Best", 12), Set Values([1, 1, 2])),
	New Column("Q", Numeric, "Continuous", Format("Best", 12), Set Values([3, 3, 6]))
);


dt &amp;lt;&amp;lt; New Column("", Numeric, Continuous, Formula(
	difval1 = Dif(:P);
	difval2 = Dif(:Q);
	If(difval1 &amp;amp; difval2,
		difval2 / difval1;
	,
		.
	);
));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can explore subexpression values from formula editor if needed&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1699622022729.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58540i3C408961305C1C72/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1699622022729.png" alt="jthi_0-1699622022729.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 13:14:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Rowwise-conditonal-calculation/m-p/696650#M88188</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-11-10T13:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: Rowwise conditonal calculation</title>
      <link>https://community.jmp.com/t5/Discussions/Rowwise-conditonal-calculation/m-p/696695#M88194</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your quick solution. Ìn the script you create&amp;nbsp; a dt. I have already create a dataset can I refer to this as well?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 14:14:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Rowwise-conditonal-calculation/m-p/696695#M88194</guid>
      <dc:creator>AAYH</dc:creator>
      <dc:date>2023-11-10T14:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Rowwise conditonal calculation</title>
      <link>https://community.jmp.com/t5/Discussions/Rowwise-conditonal-calculation/m-p/696715#M88196</link>
      <description>&lt;P&gt;You can. How you should do it, depends where you get the data table. If you open it from somewhere using &lt;A href="https://www.jmp.com/support/help/en/17.2/#page/jmp/file-functions.shtml?os=win&amp;amp;source=application#ww4959899" target="_blank" rel="noopener"&gt;Open()&lt;/A&gt; is the way to go (see Scripting Index (fround from JMP Help menu) and Scripting Guide for more information regarding scripting).&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1699627783780.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58544iE992B758371EB8D4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1699627783780.png" alt="jthi_0-1699627783780.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 14:50:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Rowwise-conditonal-calculation/m-p/696715#M88196</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-11-10T14:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Rowwise conditonal calculation</title>
      <link>https://community.jmp.com/t5/Discussions/Rowwise-conditonal-calculation/m-p/696721#M88198</link>
      <description>&lt;P&gt;Also you can directly create the formula to your data table, no need to use script editor&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;	difval1 = Dif(:P);
	difval2 = Dif(:Q);
	If(difval1 &amp;amp; difval2,
		difval2 / difval1;
	,
		.
	);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Nov 2023 14:56:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Rowwise-conditonal-calculation/m-p/696721#M88198</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-11-10T14:56:40Z</dc:date>
    </item>
  </channel>
</rss>

