<?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 to use  function to find the first position greater than the specified starting position? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-use-function-to-find-the-first-position-greater-than-the/m-p/185902#M40437</link>
    <description>&lt;P&gt;The JSL function that here corresponds to Excel's &lt;EM&gt;Match()&lt;/EM&gt; would be &lt;EM&gt;Loc().&amp;nbsp;&lt;/EM&gt;However, &lt;EM&gt;Loc()&lt;/EM&gt; returns a matrix with the position of all matches, not just the first (or last).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; New Column("match",
    formula(If(Row() &amp;gt; 4, Loc(:weight[Row() - 4 :: Row()] &amp;gt; 120)[1]))
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 10 Mar 2019 15:51:41 GMT</pubDate>
    <dc:creator>ms</dc:creator>
    <dc:date>2019-03-10T15:51:41Z</dc:date>
    <item>
      <title>How to use  function to find the first position greater than the specified starting position?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-function-to-find-the-first-position-greater-than-the/m-p/185709#M40430</link>
      <description>&lt;P&gt;Use the function to find the first position of the weight column in the top 5 rows greater than 120.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Excuse me,&amp;nbsp;Thanks!&lt;/SPAN&gt;&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="2019-03-09_15-53-29.png" style="width: 789px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/16123i87EA6D1A987AC1EB/image-size/large?v=v2&amp;amp;px=999" role="button" title="2019-03-09_15-53-29.png" alt="2019-03-09_15-53-29.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Mar 2019 08:12:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-function-to-find-the-first-position-greater-than-the/m-p/185709#M40430</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2019-03-09T08:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to use  function to find the first position greater than the specified starting position?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-function-to-find-the-first-position-greater-than-the/m-p/185718#M40431</link>
      <description>&lt;P&gt;Here is one way to do it&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;DIV&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );

dt &amp;lt;&amp;lt; New Column( "match",
	formula(
		value = .;
		If( Row() &amp;gt; 5,
			count = 0;
			For( i = Row() - 5, i &amp;lt;= Row() - 1, i++,
				count++;
				If( :weight[i] &amp;gt; 120,
					value = count;
					Break();
				);
			);
		);
		value;
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;FONT style="background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Mar 2019 12:46:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-function-to-find-the-first-position-greater-than-the/m-p/185718#M40431</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-03-09T12:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to use  function to find the first position greater than the specified starting position?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-function-to-find-the-first-position-greater-than-the/m-p/185808#M40434</link>
      <description>It seems to me that this kind of calculation is needed by fewer people.&lt;BR /&gt;&lt;BR /&gt;Thank Jim!&lt;BR /&gt;This calculation can be done in excel using a simple array formula.&lt;BR /&gt;{=MATCH(,IF(E2:E6&amp;gt;120,),)}</description>
      <pubDate>Sun, 10 Mar 2019 00:48:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-function-to-find-the-first-position-greater-than-the/m-p/185808#M40434</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2019-03-10T00:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to use  function to find the first position greater than the specified starting position?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-function-to-find-the-first-position-greater-than-the/m-p/185902#M40437</link>
      <description>&lt;P&gt;The JSL function that here corresponds to Excel's &lt;EM&gt;Match()&lt;/EM&gt; would be &lt;EM&gt;Loc().&amp;nbsp;&lt;/EM&gt;However, &lt;EM&gt;Loc()&lt;/EM&gt; returns a matrix with the position of all matches, not just the first (or last).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; New Column("match",
    formula(If(Row() &amp;gt; 4, Loc(:weight[Row() - 4 :: Row()] &amp;gt; 120)[1]))
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Mar 2019 15:51:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-function-to-find-the-first-position-greater-than-the/m-p/185902#M40437</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2019-03-10T15:51:41Z</dc:date>
    </item>
  </channel>
</rss>

