<?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: Need help for using Lag function in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Need-help-for-using-Lag-function/m-p/47258#M26941</link>
    <description>&lt;P&gt;this worked for me! thanks a lot! :)&lt;/img&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Nov 2017 07:54:42 GMT</pubDate>
    <dc:creator>switzal87</dc:creator>
    <dc:date>2017-11-15T07:54:42Z</dc:date>
    <item>
      <title>Need help for using Lag function</title>
      <link>https://community.jmp.com/t5/Discussions/Need-help-for-using-Lag-function/m-p/46807#M26665</link>
      <description>&lt;P&gt;Hello everyone!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope someone could help me with this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is is the expected output of the following code?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="123.JPG" style="width: 884px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/8224iA2ACABD58230FAA1/image-size/large?v=v2&amp;amp;px=999" role="button" title="123.JPG" alt="123.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After evaluation I get the following Log:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="12345.JPG" style="width: 350px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/8225i62000B6F6DBE2553/image-size/large?v=v2&amp;amp;px=999" role="button" title="12345.JPG" alt="12345.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the new columns just looks like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1234.JPG" style="width: 137px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/8226iD6E7EA1680F92719/image-size/large?v=v2&amp;amp;px=999" role="button" title="1234.JPG" alt="1234.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SliderID column is :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="5.JPG" style="width: 77px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/8227i15DF5467F3A518A0/image-size/large?v=v2&amp;amp;px=999" role="button" title="5.JPG" alt="5.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hope someone could enlighten me with this! thanks in advance! :)&lt;/img&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 08:49:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Need-help-for-using-Lag-function/m-p/46807#M26665</guid>
      <dc:creator>switzal87</dc:creator>
      <dc:date>2017-11-06T08:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: Need help for using Lag function</title>
      <link>https://community.jmp.com/t5/Discussions/Need-help-for-using-Lag-function/m-p/46809#M26667</link>
      <description>&lt;P&gt;Your formula is missing an if statement. It should be something like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Formula(If(:sliderID == lag(:sliderID,1),1,0))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I would recommend you get all the steps working by using the menus and mouse clicks before trying to script it.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2017 21:30:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Need-help-for-using-Lag-function/m-p/46809#M26667</guid>
      <dc:creator>stephen_pearson</dc:creator>
      <dc:date>2017-11-07T21:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: Need help for using Lag function</title>
      <link>https://community.jmp.com/t5/Discussions/Need-help-for-using-Lag-function/m-p/46810#M26668</link>
      <description>&lt;P&gt;Your formula&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;     :SliderID == Lag(:SiiderID, 1 )
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;is a boolean operation.&amp;nbsp; When the current rows value of SliderID is equal to the previous row's value os SliderID, "Lag(:SliderID, 1)", the value of the comparison will be "True" and therefore it will return a numeric value of 1.&amp;nbsp; If the comparison of the current row's value of SliderID is not equal to the previous row's value of SliderID, the returned value will be a 0.&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/3303"&gt;@stephen_pearson&lt;/a&gt;&amp;nbsp;modification of turning the formula into an "If" clause will result in the same values.&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;error that is listed out, is a response to the line&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;     dABCR &amp;lt;&amp;lt; Delete Rows;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and it is being returned, because no rows had been selected as a result of the line&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;     dABCR &amp;lt;&amp;lt; Select Where(SN == 1);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The only correction to this line would be to scope the column reference by placing a ":" in front of SN&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;     dABCR &amp;lt;&amp;lt; Select Where(:SN==1);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Nov 2017 21:34:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Need-help-for-using-Lag-function/m-p/46810#M26668</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-11-07T21:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: Need help for using Lag function</title>
      <link>https://community.jmp.com/t5/Discussions/Need-help-for-using-Lag-function/m-p/46812#M26670</link>
      <description>&lt;P&gt;Looking at the data, I don't see any repeated SliderID values, so it might be working correctly. You might use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;try(dABCE&amp;lt;&amp;lt;DeleteRows) &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to catch and ignore the error when there is nothing to delete.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;edit: well, not try, if it isn't throwing an error. Maybe &lt;A href="https://community.jmp.com/t5/Discussions/Number-of-selected-rows/td-p/3165" target="_self"&gt;this&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2017 21:35:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Need-help-for-using-Lag-function/m-p/46812#M26670</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2017-11-07T21:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: Need help for using Lag function</title>
      <link>https://community.jmp.com/t5/Discussions/Need-help-for-using-Lag-function/m-p/47258#M26941</link>
      <description>&lt;P&gt;this worked for me! thanks a lot! :)&lt;/img&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 07:54:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Need-help-for-using-Lag-function/m-p/47258#M26941</guid>
      <dc:creator>switzal87</dc:creator>
      <dc:date>2017-11-15T07:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: Need help for using Lag function</title>
      <link>https://community.jmp.com/t5/Discussions/Need-help-for-using-Lag-function/m-p/47259#M26942</link>
      <description>that was enlightening! appreciated the brief explanation on how the formula works! :)&lt;/img&gt;</description>
      <pubDate>Wed, 15 Nov 2017 07:56:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Need-help-for-using-Lag-function/m-p/47259#M26942</guid>
      <dc:creator>switzal87</dc:creator>
      <dc:date>2017-11-15T07:56:49Z</dc:date>
    </item>
  </channel>
</rss>

