<?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: Using &amp;quot;Get Rows Where&amp;quot; in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Using-quot-Get-Rows-Where-quot/m-p/36064#M21234</link>
    <description>&lt;P&gt;I am glad that you found your solution&lt;/P&gt;</description>
    <pubDate>Sat, 18 Feb 2017 12:45:47 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2017-02-18T12:45:47Z</dc:date>
    <item>
      <title>Using "Get Rows Where"</title>
      <link>https://community.jmp.com/t5/Discussions/Using-quot-Get-Rows-Where-quot/m-p/36057#M21227</link>
      <description>&lt;P&gt;I need to use Get Rows Where to get the row with value that is just below certain value.&lt;/P&gt;&lt;P&gt;In other words:&lt;/P&gt;&lt;P&gt;I have a Date A&lt;/P&gt;&lt;P&gt;I have a table with dates. I need to get the row where the date is the latest, but less than Date A&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;I have a date when person died.&lt;/P&gt;&lt;P&gt;I have table with all event when somebody logged in into his account. There are dates before and after his death.&lt;/P&gt;&lt;P&gt;I need to find the latest date he logged in before his death.&lt;/P&gt;&lt;P&gt;Something along the lines of:&lt;/P&gt;&lt;PRE&gt;lastSelfLogin = dt&amp;lt;&amp;lt;Get Rows Where(:loginDate &amp;lt; deathDate &amp;amp; /*here goes condition that this date needs to be the last*/);&lt;/PRE&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 18 Feb 2017 03:48:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-quot-Get-Rows-Where-quot/m-p/36057#M21227</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2017-02-18T03:48:48Z</dc:date>
    </item>
    <item>
      <title>Re: Using "Get Rows Where"</title>
      <link>https://community.jmp.com/t5/Discussions/Using-quot-Get-Rows-Where-quot/m-p/36058#M21228</link>
      <description>&lt;P&gt;This will do it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lastSelfLogin = Max(dt&amp;lt;&amp;lt;Get Rows Where(:loginDate &amp;lt; deathDate));&lt;/P&gt;</description>
      <pubDate>Sat, 18 Feb 2017 04:27:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-quot-Get-Rows-Where-quot/m-p/36058#M21228</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-02-18T04:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using "Get Rows Where"</title>
      <link>https://community.jmp.com/t5/Discussions/Using-quot-Get-Rows-Where-quot/m-p/36059#M21229</link>
      <description>&lt;P&gt;Jim,&lt;/P&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;I was little bit incorrect in giving my example.&amp;nbsp;Your script indeed will give the latest date of self login. However, I needed the number of row, when it happened, to find other associated values from neighbouring columns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The solution is following:&lt;/P&gt;&lt;PRE&gt;	//Finding indices for all the logins for current person before death date	
	rowPerson=dt2 &amp;lt;&amp;lt; Get Rows Where(:Person==thisPerson &amp;amp; :"DeathDate" &amp;lt; thisDate);
	//Finding index for the latest login date
	rowLatestLoginDate=Loc(loggedOn[rowPerson] == Max(loggedOn[rowPerson]));

//Then later I can access other columns. For instance, weather when person logged in himself for the last time

lastWeather=currentWeather[rowPerson[rowLatestLoginDate]];&lt;/PRE&gt;</description>
      <pubDate>Sat, 18 Feb 2017 04:43:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-quot-Get-Rows-Where-quot/m-p/36059#M21229</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2017-02-18T04:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using "Get Rows Where"</title>
      <link>https://community.jmp.com/t5/Discussions/Using-quot-Get-Rows-Where-quot/m-p/36064#M21234</link>
      <description>&lt;P&gt;I am glad that you found your solution&lt;/P&gt;</description>
      <pubDate>Sat, 18 Feb 2017 12:45:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-quot-Get-Rows-Where-quot/m-p/36064#M21234</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-02-18T12:45:47Z</dc:date>
    </item>
  </channel>
</rss>

