<?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: Forward Lag in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Forward-Lag/m-p/809112#M98870</link>
    <description>&lt;P&gt;Your IF() statement is being interpreted as you have written it.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However,&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Lag( Col Maximum( :A ), 1 )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;returns the value of&amp;nbsp;2693.162203 which will be interpreted a TRUE, so then&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Lag( :B, 1 ) + 1 / 1200&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Will be executed.&amp;nbsp; The third comparison will never be executed since the second comparison will always return a positive value.&lt;/P&gt;
&lt;P&gt;What are you expecting&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Lag( Col Maximum( :A ), 1 )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to return?&lt;/P&gt;</description>
    <pubDate>Tue, 29 Oct 2024 18:46:36 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2024-10-29T18:46:36Z</dc:date>
    <item>
      <title>Forward Lag</title>
      <link>https://community.jmp.com/t5/Discussions/Forward-Lag/m-p/809038#M98858</link>
      <description>&lt;P&gt;I am attempting to write a formula that works off a forward lag function. I have multiple data sets with values that are a function of time (1200Hz). I want to alter these columns so that the max value is equal to 0.5 seconds, so that when I graph the data, I can do so where the max values overlap. I was able to write this formula so that it works above the column max, but cannot get it to work in a reverse lag function.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If(&lt;BR /&gt;:A == Col Maximum( :A ), 0.5,&lt;BR /&gt;Lag( Col Maximum( :A ), 1 ), Lag( :B, 1 ) + 1 / 1200,&lt;BR /&gt;Lag( Col Maximum( :A ), -1 ), Lag( :B, -1 ) - 1 / 1200&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see from the preview, it works after the&amp;nbsp;&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="Picture1.png" style="width: 300px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/69633i2B9CEEACB6BDABD3/image-size/large?v=v2&amp;amp;px=999" role="button" title="Picture1.png" alt="Picture1.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 14:57:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Forward-Lag/m-p/809038#M98858</guid>
      <dc:creator>KaisersHuman</dc:creator>
      <dc:date>2024-10-29T14:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: Forward Lag</title>
      <link>https://community.jmp.com/t5/Discussions/Forward-Lag/m-p/809073#M98864</link>
      <description>&lt;P&gt;I believe this is what you need&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If(
	:A == Col Maximum( :A ), 0.5,
	Lag( :A, 1 ) == Col Maximum( :A ), Lag( :B, 1 ) + 1 / 1200,
	Lag( :A, -1 ) == Col Maximum( :A ), Lag( :B, -1 ) - 1 / 1200
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;BTW.....it is much handier for the responder to have your sample data not just displayed as a picture, but also to have it in a machine readable form.&amp;nbsp; Attaching your data table would be nice.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 15:58:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Forward-Lag/m-p/809073#M98864</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-10-29T15:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: Forward Lag</title>
      <link>https://community.jmp.com/t5/Discussions/Forward-Lag/m-p/809105#M98868</link>
      <description>&lt;P&gt;Hi, thank you for the reply!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That didn't quite obtain what I was looking for. Thank you for the note about attaching data, as this is my first question - I wasn't sure the proper protocol. I have attached below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you'll see Column B's output formula creates the desired product above 0.5, counting 1/1200 sec up from there, but I need it to count backward by 1/1200 of a second from 0.5, which is where I am struggling since it is dependent on the columnmax from column A&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 18:11:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Forward-Lag/m-p/809105#M98868</guid>
      <dc:creator>KaisersHuman</dc:creator>
      <dc:date>2024-10-29T18:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: Forward Lag</title>
      <link>https://community.jmp.com/t5/Discussions/Forward-Lag/m-p/809112#M98870</link>
      <description>&lt;P&gt;Your IF() statement is being interpreted as you have written it.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However,&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Lag( Col Maximum( :A ), 1 )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;returns the value of&amp;nbsp;2693.162203 which will be interpreted a TRUE, so then&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Lag( :B, 1 ) + 1 / 1200&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Will be executed.&amp;nbsp; The third comparison will never be executed since the second comparison will always return a positive value.&lt;/P&gt;
&lt;P&gt;What are you expecting&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Lag( Col Maximum( :A ), 1 )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to return?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 18:46:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Forward-Lag/m-p/809112#M98870</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-10-29T18:46:36Z</dc:date>
    </item>
  </channel>
</rss>

