<?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: How Can I Get The Lag Function to &amp;quot;Reset&amp;quot; With Each New Batch? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-Can-I-Get-The-Lag-Function-to-quot-Reset-quot-With-Each-New/m-p/826813#M100800</link>
    <description>&lt;P&gt;You can also utilize Col Moving Average to get the previous value (&lt;LI-MESSAGE title="Data preparation- substract column data by other column" uid="762950" url="https://community.jmp.com/t5/Discussions/Data-preparation-substract-column-data-by-other-column/m-p/762950#U762950" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;:Result- (Col Moving Average(:Result, 1, 1, 0, :Lot Number) * 2 - :Result)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but in your case using something like Jim suggested is most likely better. Also there is Dif function you can use instead of Lag&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If( :"Time Point (months)"n == 0,
	.,
	Dif(:Result, 1)
)&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 10 Jan 2025 21:43:44 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2025-01-10T21:43:44Z</dc:date>
    <item>
      <title>How Can I Get The Lag Function to "Reset" With Each New Batch?</title>
      <link>https://community.jmp.com/t5/Discussions/How-Can-I-Get-The-Lag-Function-to-quot-Reset-quot-With-Each-New/m-p/826802#M100798</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following data and I want to use the Lag function to calculate the difference between each result and the result prior to it (the data table is also attached to this message).&lt;/P&gt;&lt;P&gt;I am using JMP 16.&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="jgross_2-1736542505146.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/71841i5F4F56B3D78F55ED/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jgross_2-1736542505146.png" alt="jgross_2-1736542505146.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Currently I'm using the following formula in the "Difference" column:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jgross_0-1736542408545.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/71839i66022B4EC7E17064/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jgross_0-1736542408545.png" alt="jgross_0-1736542408545.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What I can't figure out is how to get the calculation to "reset" once it gets to Batch B. I realize that even with my current formula, only the difference value in row 16 is incorrect, but still I would know to setup the formula so that it works properly within batches.&lt;/P&gt;&lt;P&gt;Does anyone have any suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jeff&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2025 21:08:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-Can-I-Get-The-Lag-Function-to-quot-Reset-quot-With-Each-New/m-p/826802#M100798</guid>
      <dc:creator>jeff_gross</dc:creator>
      <dc:date>2025-01-10T21:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: How Can I Get The Lag Function to "Reset" With Each New Batch?</title>
      <link>https://community.jmp.com/t5/Discussions/How-Can-I-Get-The-Lag-Function-to-quot-Reset-quot-With-Each-New/m-p/826812#M100799</link>
      <description>&lt;P&gt;change your formula to&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If( :"Time Point (months)"n == 0,
	.,
	:Result - Lag( :Result )
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2025 21:28:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-Can-I-Get-The-Lag-Function-to-quot-Reset-quot-With-Each-New/m-p/826812#M100799</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2025-01-10T21:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: How Can I Get The Lag Function to "Reset" With Each New Batch?</title>
      <link>https://community.jmp.com/t5/Discussions/How-Can-I-Get-The-Lag-Function-to-quot-Reset-quot-With-Each-New/m-p/826813#M100800</link>
      <description>&lt;P&gt;You can also utilize Col Moving Average to get the previous value (&lt;LI-MESSAGE title="Data preparation- substract column data by other column" uid="762950" url="https://community.jmp.com/t5/Discussions/Data-preparation-substract-column-data-by-other-column/m-p/762950#U762950" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;:Result- (Col Moving Average(:Result, 1, 1, 0, :Lot Number) * 2 - :Result)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but in your case using something like Jim suggested is most likely better. Also there is Dif function you can use instead of Lag&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If( :"Time Point (months)"n == 0,
	.,
	Dif(:Result, 1)
)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Jan 2025 21:43:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-Can-I-Get-The-Lag-Function-to-quot-Reset-quot-With-Each-New/m-p/826813#M100800</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-01-10T21:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: How Can I Get The Lag Function to "Reset" With Each New Batch?</title>
      <link>https://community.jmp.com/t5/Discussions/How-Can-I-Get-The-Lag-Function-to-quot-Reset-quot-With-Each-New/m-p/826826#M100803</link>
      <description>&lt;P&gt;Thank you for the quick replies&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Much appreciated!!&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jan 2025 01:01:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-Can-I-Get-The-Lag-Function-to-quot-Reset-quot-With-Each-New/m-p/826826#M100803</guid>
      <dc:creator>jeff_gross</dc:creator>
      <dc:date>2025-01-11T01:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: How Can I Get The Lag Function to "Reset" With Each New Batch?</title>
      <link>https://community.jmp.com/t5/Discussions/How-Can-I-Get-The-Lag-Function-to-quot-Reset-quot-With-Each-New/m-p/826840#M100810</link>
      <description>&lt;P&gt;If you need such grouped &lt;FONT face="courier new,courier"&gt;lag&lt;/FONT&gt; operations frequently, you might have a look at&amp;nbsp;&lt;BR /&gt;&lt;A href="https://marketplace.jmp.com/appdetails/Normalization+GUI" target="_blank"&gt;https://marketplace.jmp.com/appdetails/Normalization+GUI&lt;/A&gt;&amp;nbsp;in the Marketplace.&lt;BR /&gt;&lt;BR /&gt;It implemented the N-1 in combination with grouping based on&amp;nbsp;&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;'s approach:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1736585657173.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/71851iD016D41706668FF7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1736585657173.png" alt="hogi_0-1736585657173.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This takes the pain to remember the exact syntax : )&lt;/P&gt;&lt;P&gt;In addition, the Platform handles &lt;FONT face="courier new,courier"&gt;Excluded&amp;nbsp;&lt;/FONT&gt;rows automatically.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jan 2025 08:56:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-Can-I-Get-The-Lag-Function-to-quot-Reset-quot-With-Each-New/m-p/826840#M100810</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2025-01-11T08:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: How Can I Get The Lag Function to "Reset" With Each New Batch?</title>
      <link>https://community.jmp.com/t5/Discussions/How-Can-I-Get-The-Lag-Function-to-quot-Reset-quot-With-Each-New/m-p/886878#M104929</link>
      <description>&lt;P&gt;&lt;LI-MESSAGE title="Dif() and Lag() formula functions by column group (byVar argument)" uid="621024" url="https://community.jmp.com/t5/JMP-Wish-List/Dif-and-Lag-formula-functions-by-column-group-byVar-argument/m-p/621024#U621024" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-idea-thread lia-fa-icon lia-fa-idea lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;- great wish by&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/13827"&gt;@FN&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-&amp;gt; In JMP19, &lt;FONT face="courier new,courier"&gt;lag()&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;dif()&lt;/FONT&gt;&amp;nbsp;can be calculated via&amp;nbsp;&amp;nbsp;&lt;FONT face="courier new,courier"&gt;Col At ()&lt;/FONT&gt; - which provides a grouping option.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jul 2025 11:14:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-Can-I-Get-The-Lag-Function-to-quot-Reset-quot-With-Each-New/m-p/886878#M104929</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2025-07-15T11:14:18Z</dc:date>
    </item>
  </channel>
</rss>

