<?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: Recoding Columns using IF statements in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Recoding-Columns-using-IF-statements/m-p/227544#M45143</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You could use the following formula (copy and paste in the Formula Editor)&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;	If( Row() == 1,
		1,
		If( :EndTime Id != Lag( :EndTime Id, 1 ),
			Lag( :RUN NUMBER, 1 ) + 1,
			Lag( RUN NUMBER, 1 )
		)
	);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This will only work properly if the table is sorted by EndTime Id&lt;/P&gt;</description>
    <pubDate>Fri, 27 Sep 2019 18:14:49 GMT</pubDate>
    <dc:creator>Thierry_S</dc:creator>
    <dc:date>2019-09-27T18:14:49Z</dc:date>
    <item>
      <title>Recoding Columns using IF statements</title>
      <link>https://community.jmp.com/t5/Discussions/Recoding-Columns-using-IF-statements/m-p/227528#M45138</link>
      <description>&lt;P&gt;Hello JMP Experts,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I am new to IF statements and would like to use one (or something else that would accomplish the same thing) to recode a column that has a value tied to another columns value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So in the example below:&lt;/P&gt;&lt;P&gt;EndTime Id is a unique run ID for 8 channels.&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are 10 repair intervals.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to assign a continuous run number (see empty column) for each unique EndTime Id, that restarts with 1 when the repair interval changes.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&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="Capture.JPG" style="width: 471px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/19496iE9DCE2B16E3B7CB3/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2019 16:28:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Recoding-Columns-using-IF-statements/m-p/227528#M45138</guid>
      <dc:creator>lizrdee</dc:creator>
      <dc:date>2019-09-27T16:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Recoding Columns using IF statements</title>
      <link>https://community.jmp.com/t5/Discussions/Recoding-Columns-using-IF-statements/m-p/227544#M45143</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You could use the following formula (copy and paste in the Formula Editor)&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;	If( Row() == 1,
		1,
		If( :EndTime Id != Lag( :EndTime Id, 1 ),
			Lag( :RUN NUMBER, 1 ) + 1,
			Lag( RUN NUMBER, 1 )
		)
	);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This will only work properly if the table is sorted by EndTime Id&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2019 18:14:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Recoding-Columns-using-IF-statements/m-p/227544#M45143</guid>
      <dc:creator>Thierry_S</dc:creator>
      <dc:date>2019-09-27T18:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: Recoding Columns using IF statements</title>
      <link>https://community.jmp.com/t5/Discussions/Recoding-Columns-using-IF-statements/m-p/227545#M45144</link>
      <description>&lt;P&gt;There is a small error in the formula: I forgot to precede one to RUN NUMBER call with ":"&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If( Row() == 1,
	1,
	If( :EndTime Id != Lag( :EndTime Id, 1 ),
		Lag( :RUN NUMBER, 1 ) + 1,
		Lag( :RUN NUMBER, 1 )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Sep 2019 19:17:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Recoding-Columns-using-IF-statements/m-p/227545#M45144</guid>
      <dc:creator>Thierry_S</dc:creator>
      <dc:date>2019-09-27T19:17:54Z</dc:date>
    </item>
    <item>
      <title>Re: Recoding Columns using IF statements</title>
      <link>https://community.jmp.com/t5/Discussions/Recoding-Columns-using-IF-statements/m-p/227619#M45166</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/11182"&gt;@lizrdee&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Most&amp;nbsp;likely &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/11634"&gt;@Thierry_S&lt;/a&gt; 's answer is sufficient.&lt;/P&gt;
&lt;P&gt;Otherwise, take a look at this discussion&lt;BR /&gt;&lt;A href="https://community.jmp.com/t5/Discussions/Syntax-How-do-I-create-an-index-column-by-ID/m-p/9751" target="_blank" rel="noopener"&gt;How do I create an index column by ID?&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Sep 2019 08:59:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Recoding-Columns-using-IF-statements/m-p/227619#M45166</guid>
      <dc:creator>ron_horne</dc:creator>
      <dc:date>2019-09-29T08:59:00Z</dc:date>
    </item>
  </channel>
</rss>

