<?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: get rows where returning empty matrix in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/get-rows-where-returning-empty-matrix/m-p/11433#M10960</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A comparison of a &lt;EM&gt;Column object&lt;/EM&gt; with a &lt;EM&gt;string&lt;/EM&gt; will return always return false. In certain cases (or in general?) JMP must be expliticly told that you refer to a Column or to the Column values (I remember there has been a good thread about this maybe a little confusing difference but I can't find it now...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can access data with indices (as you showed above with Column( dtx, 1 ) [1] == "aaa"). In functions like G&lt;EM&gt;et Rows Where()&lt;/EM&gt; that basically iterate through all column values, each value can be accessed with either of the below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) &lt;SPAN style="color: #032ce4;"&gt;Column&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;dtx&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;)[]&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;==&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #942193;"&gt;"aaa"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;// Note the empty brackets&lt;/P&gt;&lt;P&gt;2) As Column&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;dtx&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;==&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #942193;"&gt;"aaa"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;3) Or simplest with scoping colon as C Hales showed above&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 14 Mar 2015 08:13:19 GMT</pubDate>
    <dc:creator>ms</dc:creator>
    <dc:date>2015-03-14T08:13:19Z</dc:date>
    <item>
      <title>get rows where returning empty matrix</title>
      <link>https://community.jmp.com/t5/Discussions/get-rows-where-returning-empty-matrix/m-p/11431#M10958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a data table that I am trying to manipulate. I am using get rows where function to find where the first column equals a string, let's call it "aaa". When I use the software to do this, it works fine and two rows are selected, row 1 and row 2240. When I try to script this, the result is an empty matrix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the script I am using:&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote" modifiedtitle="true"&gt;&lt;BR /&gt;&lt;P&gt;Names Default To Here( 1 );&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;dtx = Current Data Table();&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;noRows = N Rows( dtx );&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;ddd = dtx &amp;lt;&amp;lt; Get Rows Where( Column( dtx, 1 ) == "aaa" );&lt;/P&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;and the result is &lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;BR /&gt;&lt;P&gt;[](0, 1)&lt;/P&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;note that this returns a 1&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote" modifiedtitle="true"&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13.3333330154419px;"&gt;Column( dtx, 1 ) [1] == "aaa"&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;Does anyone have any idea what I am doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;P&gt;Heather&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Mar 2015 02:40:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/get-rows-where-returning-empty-matrix/m-p/11431#M10958</guid>
      <dc:creator>h_lazar</dc:creator>
      <dc:date>2015-03-14T02:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: get rows where returning empty matrix</title>
      <link>https://community.jmp.com/t5/Discussions/get-rows-where-returning-empty-matrix/m-p/11432#M10959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I looks like Get Rows Where wants a simpler argument, try one of these&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14263027599879663" jivemacro_uid="_14263027599879663"&gt;&lt;BR /&gt;&lt;P&gt;dtx=open("$sample_data/big class.jmp");&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;c=column(dtx,3);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;dtx&amp;lt;&amp;lt;get rows where( dtx:c == "F" );&lt;/P&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14263027671183833" jivemacro_uid="_14263027671183833"&gt;&lt;BR /&gt;&lt;P&gt;dtx=open("$sample_data/big class.jmp");&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;dtx&amp;lt;&amp;lt;get rows where( dtx:sex == "F" );&lt;/P&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the odd looking returned value, &lt;SPAN style="color: #555555; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;[](0, 1), is JMP's empty array of 0 rows and 1 column.&amp;nbsp; the two examples return more rows, of one column:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[1, 2, 3, 4, 5, 9, 10, 11, 16, 17, 18, 19, 20, 28, 29, 35, 36, 38]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Mar 2015 03:17:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/get-rows-where-returning-empty-matrix/m-p/11432#M10959</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2015-03-14T03:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: get rows where returning empty matrix</title>
      <link>https://community.jmp.com/t5/Discussions/get-rows-where-returning-empty-matrix/m-p/11433#M10960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A comparison of a &lt;EM&gt;Column object&lt;/EM&gt; with a &lt;EM&gt;string&lt;/EM&gt; will return always return false. In certain cases (or in general?) JMP must be expliticly told that you refer to a Column or to the Column values (I remember there has been a good thread about this maybe a little confusing difference but I can't find it now...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can access data with indices (as you showed above with Column( dtx, 1 ) [1] == "aaa"). In functions like G&lt;EM&gt;et Rows Where()&lt;/EM&gt; that basically iterate through all column values, each value can be accessed with either of the below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) &lt;SPAN style="color: #032ce4;"&gt;Column&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;dtx&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;)[]&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;==&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #942193;"&gt;"aaa"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;// Note the empty brackets&lt;/P&gt;&lt;P&gt;2) As Column&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;dtx&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;==&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #942193;"&gt;"aaa"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;3) Or simplest with scoping colon as C Hales showed above&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Mar 2015 08:13:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/get-rows-where-returning-empty-matrix/m-p/11433#M10960</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2015-03-14T08:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: get rows where returning empty matrix</title>
      <link>https://community.jmp.com/t5/Discussions/get-rows-where-returning-empty-matrix/m-p/11434#M10961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;BR /&gt;&lt;P&gt;dtx=open("$sample_data/big class.jmp"); &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;c=column(dtx,3); &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;dtx&amp;lt;&amp;lt;get rows where( dtx:c == "F" ); &lt;/P&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;This did work, thank you both.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;H&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Mar 2015 10:50:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/get-rows-where-returning-empty-matrix/m-p/11434#M10961</guid>
      <dc:creator>h_lazar</dc:creator>
      <dc:date>2015-03-14T10:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: get rows where returning empty matrix</title>
      <link>https://community.jmp.com/t5/Discussions/get-rows-where-returning-empty-matrix/m-p/11435#M10962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;cool.&amp;nbsp; I didn't read the original question closely enough, and I'd forgotten about the empty [] anyway.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Mar 2015 12:25:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/get-rows-where-returning-empty-matrix/m-p/11435#M10962</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2015-03-14T12:25:38Z</dc:date>
    </item>
  </channel>
</rss>

