<?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: LAG function in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/LAG-function/m-p/104830#M38834</link>
    <description>&lt;P&gt;add | row() == 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; select where( :name( "Run" )[Row()] != Lag( :name( "Run" )[Row()] ) | Row() == 1 );&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 08 Jan 2019 20:48:49 GMT</pubDate>
    <dc:creator>vince_faller</dc:creator>
    <dc:date>2019-01-08T20:48:49Z</dc:date>
    <item>
      <title>LAG function</title>
      <link>https://community.jmp.com/t5/Discussions/LAG-function/m-p/104828#M38833</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm hoping this is an easy line of code someone can help me with.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a LAG function script written, but it's not letting me grab the first Run.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I get it to see that there's a Run 1, and not just skip it?&lt;/P&gt;&lt;P&gt;Attached is the data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's my script:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt = Current Data Table();
dt &amp;lt;&amp;lt; select where( :name( "Run" )[Row()] != Lag( :name( "Run" )[Row()] ) );

dtNew = dt &amp;lt;&amp;lt; subset( selected columns( 0 ), selected rows( 1 ) );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 20:40:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/LAG-function/m-p/104828#M38833</guid>
      <dc:creator>kwmcm</dc:creator>
      <dc:date>2019-01-08T20:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: LAG function</title>
      <link>https://community.jmp.com/t5/Discussions/LAG-function/m-p/104830#M38834</link>
      <description>&lt;P&gt;add | row() == 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; select where( :name( "Run" )[Row()] != Lag( :name( "Run" )[Row()] ) | Row() == 1 );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Jan 2019 20:48:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/LAG-function/m-p/104830#M38834</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2019-01-08T20:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: LAG function</title>
      <link>https://community.jmp.com/t5/Discussions/LAG-function/m-p/104831#M38835</link>
      <description>THANK YOU!</description>
      <pubDate>Tue, 08 Jan 2019 20:50:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/LAG-function/m-p/104831#M38835</guid>
      <dc:creator>kwmcm</dc:creator>
      <dc:date>2019-01-08T20:50:16Z</dc:date>
    </item>
  </channel>
</rss>

