<?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: Finding consecutive column and rows in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Finding-consecutive-column-and-rows/m-p/778927#M96032</link>
    <description>&lt;P&gt;Yes, you need to change the 4 to 7 and the -3 to -6.&lt;/P&gt;
&lt;P&gt;The weighting factor provides the ability to set weight of each of the values being average.&amp;nbsp; The value of 1 indicates to use equal weighting on each value.&lt;/P&gt;
&lt;P&gt;Before = sets the number of rows before&amp;nbsp; the current row to use in the calculation of the moving average.&lt;/P&gt;
&lt;P&gt;After = sets the number of rows after the current row to use in the calculation of the moving average.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally, please use the JSL icon at the top of the Preview when&amp;nbsp; entering JSL into the discussion.&amp;nbsp; It really help the readers read and interpret the code.&lt;/P&gt;
&lt;P&gt;I have edited your last response, and moved your listed JSL into a JSL display box&lt;/P&gt;</description>
    <pubDate>Sat, 03 Aug 2024 21:04:16 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2024-08-03T21:04:16Z</dc:date>
    <item>
      <title>Finding consecutive column and rows</title>
      <link>https://community.jmp.com/t5/Discussions/Finding-consecutive-column-and-rows/m-p/778836#M96027</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Attached is the data table of 2 PARTS namely PART-02 and PART-03. Each part has it's own columns and rows (ColX, RowY). I wish to use JSL to identify the PART which has consecutive columns or rows appearing more than 4. Here PART-02 is the one that has rows appearing more than 4 times consecutively. I want my output to be just a table with PART ID and the result like below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="cchueng_0-1722704004850.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/66808iAD54840CC3D80A9C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="cchueng_0-1722704004850.png" alt="cchueng_0-1722704004850.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="cchueng_1-1722704169769.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/66809i5DFD14EC296D6D22/image-size/medium?v=v2&amp;amp;px=400" role="button" title="cchueng_1-1722704169769.png" alt="cchueng_1-1722704169769.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Aug 2024 16:59:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Finding-consecutive-column-and-rows/m-p/778836#M96027</guid>
      <dc:creator>cchueng</dc:creator>
      <dc:date>2024-08-03T16:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: Finding consecutive column and rows</title>
      <link>https://community.jmp.com/t5/Discussions/Finding-consecutive-column-and-rows/m-p/778878#M96028</link>
      <description>&lt;P&gt;Here is the JSL that I came up with that creates the new table and populates it as you specified&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

dtResults = dt &amp;lt;&amp;lt;
summary(
	group( :LotLabel, :WaferLabel ),
	output table( "Results" ),
	Link to Original Data Table( 0 )
);
dtResults &amp;lt;&amp;lt; delete columns( :N Rows );
dtResults &amp;lt;&amp;lt; New Column( "Results",
	character,
	set each value( "FAIL" )
);

For Each Row(
	dt,
	If( Row() &amp;gt;= 4,
		If(
			Col Moving Average(
				:ColX,
				weighting = 1,
				before = -3,
				after = 0,
				:LotLabel,
				:WaferLabel
			) == :ColX |
			Col Moving Average(
				:RowY,
				weighting = 1,
				before = -3,
				after = 0,
				:LotLabel,
				:WaferLabel
			) == :RowY,
			dtResults:Results[dtResults &amp;lt;&amp;lt; get rows where(
				dtResults:LotLabel == dt:LotLabel &amp;amp;
				dtResults:WaferLabel == dt:WaferLabel 
			)]  = "PASS"
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1722708023061.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/66812i73D86E56C5E51A0B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1722708023061.png" alt="txnelson_0-1722708023061.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Aug 2024 18:00:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Finding-consecutive-column-and-rows/m-p/778878#M96028</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-08-03T18:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: Finding consecutive column and rows</title>
      <link>https://community.jmp.com/t5/Discussions/Finding-consecutive-column-and-rows/m-p/778921#M96031</link>
      <description>&lt;P&gt;Hi Jim, in the previous dataset, for PART-01, 02 should be pass. Sorry for the misinformation. Attached is a larger dataset including PART-01,02,03,17. Part-01,02,03 should be Pass and only PART-17 should fail.&amp;nbsp; It should&amp;nbsp; be&amp;nbsp; as below but your script is stating PART02,03 are failing as well.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="cchueng_0-1722719709828.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/66815i5BA1A0A41F2F8692/image-size/medium?v=v2&amp;amp;px=400" role="button" title="cchueng_0-1722719709828.png" alt="cchueng_0-1722719709828.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Aug 2024 21:16:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Finding-consecutive-column-and-rows/m-p/778921#M96031</guid>
      <dc:creator>cchueng</dc:creator>
      <dc:date>2024-08-03T21:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: Finding consecutive column and rows</title>
      <link>https://community.jmp.com/t5/Discussions/Finding-consecutive-column-and-rows/m-p/778927#M96032</link>
      <description>&lt;P&gt;Yes, you need to change the 4 to 7 and the -3 to -6.&lt;/P&gt;
&lt;P&gt;The weighting factor provides the ability to set weight of each of the values being average.&amp;nbsp; The value of 1 indicates to use equal weighting on each value.&lt;/P&gt;
&lt;P&gt;Before = sets the number of rows before&amp;nbsp; the current row to use in the calculation of the moving average.&lt;/P&gt;
&lt;P&gt;After = sets the number of rows after the current row to use in the calculation of the moving average.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally, please use the JSL icon at the top of the Preview when&amp;nbsp; entering JSL into the discussion.&amp;nbsp; It really help the readers read and interpret the code.&lt;/P&gt;
&lt;P&gt;I have edited your last response, and moved your listed JSL into a JSL display box&lt;/P&gt;</description>
      <pubDate>Sat, 03 Aug 2024 21:04:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Finding-consecutive-column-and-rows/m-p/778927#M96032</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-08-03T21:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: Finding consecutive column and rows</title>
      <link>https://community.jmp.com/t5/Discussions/Finding-consecutive-column-and-rows/m-p/778940#M96033</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi Jim, in the previous dataset, for PART-01, 02 should be pass. Sorry for the misinformation. Attached is a larger dataset including PART-01,02,03,17. Part-01,02,03 should be Pass and only PART-17 should fail.&amp;nbsp; It should&amp;nbsp; be&amp;nbsp; as below but your script is stating PART02,03 are failing as well.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="cchueng_0-1722720748520.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/66816i1E9B8CE1E2DA3248/image-size/medium?v=v2&amp;amp;px=400" role="button" title="cchueng_0-1722720748520.png" alt="cchueng_0-1722720748520.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Aug 2024 21:33:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Finding-consecutive-column-and-rows/m-p/778940#M96033</guid>
      <dc:creator>cchueng</dc:creator>
      <dc:date>2024-08-03T21:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: Finding consecutive column and rows</title>
      <link>https://community.jmp.com/t5/Discussions/Finding-consecutive-column-and-rows/m-p/778954#M96034</link>
      <description>&lt;OL&gt;
&lt;LI&gt;The use of the Col Moving Average as the check did not work so I changed it to using a Standard Deviation over the 7 rows.&lt;/LI&gt;
&lt;LI&gt;The method I was using to find the row in the dtResults data table was not working.&amp;nbsp; I had to change to a For() loop to be able to get the exactness required.&lt;/LI&gt;
&lt;LI&gt;I had the logic backwards.....Passing if finding the values in a row, rather than Failing when that happened.&lt;/LI&gt;
&lt;/OL&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

dtResults = dt &amp;lt;&amp;lt; summary(
	group( :LotLabel, :WaferLabel ),
	output table( "Results" ),
	Link to Original Data Table( 0 )
);
dtResults &amp;lt;&amp;lt; delete columns( :N Rows );
dtResults &amp;lt;&amp;lt; New Column( "Results",
	character,
	set each value( "PASS" )
);

For( i = 1, i &amp;lt;= N Rows( dt ), i++,
	If( i &amp;gt;= 7,
		If(
			Std Dev( dt:ColX[i - 6 :: i] ) == 0 |
			Std Dev( dt:RowY[i - 6 :: i] ) == 0,
			dtResults:Results[dtResults &amp;lt;&amp;lt;
			get rows where(
				dtResults:LotLabel == dt:LotLabel[i] &amp;amp; dtResults
				:WaferLabel == dt:WaferLabel[i]
			)] = "FAIL"
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You need to study the code, don't just cut and paste it into your script.&amp;nbsp; You need to be learned enough to be able to debug future issues and to generate the fixes.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Aug 2024 00:53:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Finding-consecutive-column-and-rows/m-p/778954#M96034</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-08-04T00:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: Finding consecutive column and rows</title>
      <link>https://community.jmp.com/t5/Discussions/Finding-consecutive-column-and-rows/m-p/779097#M96038</link>
      <description>&lt;P&gt;Thanks, Jim. After some adjustments, it worked for me.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Aug 2024 20:42:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Finding-consecutive-column-and-rows/m-p/779097#M96038</guid>
      <dc:creator>cchueng</dc:creator>
      <dc:date>2024-08-04T20:42:01Z</dc:date>
    </item>
  </channel>
</rss>

