<?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 JSL to filter out the number of rows according to the number of rows in a column? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-filter-out-the-number-of-rows-according-to-the/m-p/270128#M52577</link>
    <description>&lt;P&gt;Here is one way to do it&lt;/P&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; select where( col number(:height, :age) == 7);

dt7 = dt &amp;lt;&amp;lt; subset( selected rows(1), selected columns(0));&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 02 Jun 2020 04:19:40 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2020-06-02T04:19:40Z</dc:date>
    <item>
      <title>How to use JSL to filter out the number of rows according to the number of rows in a column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-filter-out-the-number-of-rows-according-to-the/m-p/270125#M52576</link>
      <description>&lt;P&gt;For example, use A to filter out the number of rows whose age is equal to 7.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2020-06-02_11-04.png" style="width: 544px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/24287i3DF6B857FACE9D45/image-size/large?v=v2&amp;amp;px=999" role="button" title="2020-06-02_11-04.png" alt="2020-06-02_11-04.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:27:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-filter-out-the-number-of-rows-according-to-the/m-p/270125#M52576</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2023-06-09T23:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to use JSL to filter out the number of rows according to the number of rows in a column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-filter-out-the-number-of-rows-according-to-the/m-p/270128#M52577</link>
      <description>&lt;P&gt;Here is one way to do it&lt;/P&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; select where( col number(:height, :age) == 7);

dt7 = dt &amp;lt;&amp;lt; subset( selected rows(1), selected columns(0));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Jun 2020 04:19:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-filter-out-the-number-of-rows-according-to-the/m-p/270128#M52577</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-06-02T04:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to use JSL to filter out the number of rows according to the number of rows in a column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-filter-out-the-number-of-rows-according-to-the/m-p/270133#M52578</link>
      <description>&lt;P&gt;Thank Jim!&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; select where( Col Number( :height, :age ) == 7 );
dt &amp;lt;&amp;lt; select where( Col Number( :weight, :age ) == 7 );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;The effect is the same b&lt;/SPAN&gt;ut this modification does not work:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; select where( Col Number( :age ) == 7 );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Don't understand the principle.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jun 2020 10:25:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-filter-out-the-number-of-rows-according-to-the/m-p/270133#M52578</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2020-06-02T10:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to use JSL to filter out the number of rows according to the number of rows in a column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-filter-out-the-number-of-rows-according-to-the/m-p/270137#M52579</link>
      <description>&lt;P&gt;The function Col Number() calculates the count of the column specified&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;col number(:height )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Counts the number of rows for the column :Height that are non missing values, so in the example with data table Big Class, it will return the value of 40.&lt;/P&gt;
&lt;P&gt;The Col Number() function can have more than one value passed to it.&amp;nbsp; The first value is the column for count the number of non missing values, and the 2nd through n additional columns, are "By Group" columns.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;col number(:Height, :age )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The above function call, calculates the count of the non missing values of :Height for the rows current value of :age.&amp;nbsp; So for row 1 in the data table, the function will only count the non missing values of :Height for the rows with the :Age value of 12.&amp;nbsp; It will return the value 8. When it comes to row 9, the value of age is 13, and the number of non missing values of :Height for the rows with the Age value of 13 is 7.&lt;/P&gt;
&lt;P&gt;But why are we counting the number of non missing values of :Height.&amp;nbsp; For no other reason than we no it has no missing values, and therefore, it will return a proper count.&amp;nbsp; We could actually use any of the numeric columns, since there are no non missing values for any of the numeric columns.&lt;/P&gt;
&lt;P&gt;Initially, I was going to specify the function call like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;col number(:age, :age )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but changed it to :Height, since I thought using :Age twice would be confusing&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jun 2020 05:01:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-filter-out-the-number-of-rows-according-to-the/m-p/270137#M52579</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-06-02T05:01:11Z</dc:date>
    </item>
  </channel>
</rss>

