<?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: Row Problem in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Row-Problem/m-p/733169#M91452</link>
    <description>&lt;P&gt;Thanks, I also want to know it.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Mar 2024 07:23:27 GMT</pubDate>
    <dc:creator>VioletHartman</dc:creator>
    <dc:date>2024-03-12T07:23:27Z</dc:date>
    <item>
      <title>Row Problem</title>
      <link>https://community.jmp.com/t5/Discussions/Row-Problem/m-p/724712#M90779</link>
      <description>&lt;P&gt;I have a two part question. I am trying to change the value of previous rows in a column based on data in another column and I'm having a couple of problems. In the example below, when the status changes from Status1 to anything else (note green cells), I want to change the value of the cell 6 rows up (red cell).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-02-19_11-50-48.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/61250i456CC1ED343642CD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2024-02-19_11-50-48.png" alt="2024-02-19_11-50-48.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The column formula I am using is below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-02-19_12-13-53.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/61251i8445A6559B7AAA3C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2024-02-19_12-13-53.png" alt="2024-02-19_12-13-53.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see from the table, the script does insert a 99 in Row()-6 but there is also a 99 in Row(). I can't figure out where that last one is coming from.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The larger problem I'm trying to solve here is that I want to fill in all cells at and above the status change with 99 (So Row(), Row()-1, Row()-2, ... , Row()-6 all are 99). I tried to use a FOR loop to do this (see second script below) but it does nothing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-02-19_12-19-16.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/61252iAB5BC2C5D872C626/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2024-02-19_12-19-16.png" alt="2024-02-19_12-19-16.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I'm sure you can tell, I'm pretty ignorant regarding JSL so any assistance on this would be greatly appreciated. Thanks much.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 18:25:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Row-Problem/m-p/724712#M90779</guid>
      <dc:creator>scott1588</dc:creator>
      <dc:date>2024-02-19T18:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: Row Problem</title>
      <link>https://community.jmp.com/t5/Discussions/Row-Problem/m-p/724715#M90781</link>
      <description>&lt;P&gt;As I don't have your data table this is just a guess&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = New Table("Untitled 2",
	Add Rows(23),
	Compress File When Saved(1),
	New Column("S",
		Character,
		"Nominal",
		Set Values(
			{"A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A",
			"A", "B", "B", "B", "C", "C"}
		)
	)
);

dt &amp;lt;&amp;lt; New Column("R", Numeric, Continuous, Formula(
	If(:S == "A" &amp;amp; Lag(:S, -6) != "A",
		99
	, :S == "A",
		Lag(:R)
	);
));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can use Lag to look for values behind and also forward.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 19:11:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Row-Problem/m-p/724715#M90781</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-02-19T19:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: Row Problem</title>
      <link>https://community.jmp.com/t5/Discussions/Row-Problem/m-p/724845#M90826</link>
      <description>&lt;P&gt;Thanks much for the help! I didn't know you could have negative lags. That's very handy.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 23:18:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Row-Problem/m-p/724845#M90826</guid>
      <dc:creator>scott1588</dc:creator>
      <dc:date>2024-02-20T23:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: Row Problem</title>
      <link>https://community.jmp.com/t5/Discussions/Row-Problem/m-p/733169#M91452</link>
      <description>&lt;P&gt;Thanks, I also want to know it.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 07:23:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Row-Problem/m-p/733169#M91452</guid>
      <dc:creator>VioletHartman</dc:creator>
      <dc:date>2024-03-12T07:23:27Z</dc:date>
    </item>
  </channel>
</rss>

