<?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 JSL-create subset data table with row selection defined by column value in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-create-subset-data-table-with-row-selection-defined-by/m-p/464565#M70904</link>
    <description>&lt;P&gt;Just started learning JSL , using JMP16&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Trying to write a script to create a subset data table with selected row, the selection critera are defined by numeric values in column(7).&lt;/P&gt;&lt;P&gt;The backbone of the following script is from "subset" run under the "Tables" tab.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Data Table( "Subset of 200 kinome all excel" ) &amp;lt;&amp;lt;
Subset(
	Linked,
	
	selected rows only(0),
	row selection (select where (as column(7) &amp;gt;0.3) );

	Selected columns only(0),
	
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The selection of the above script did not work. The subset table is identical to the original one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What did I miss?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 18:11:40 GMT</pubDate>
    <dc:creator>GroupSquareWolf</dc:creator>
    <dc:date>2023-06-09T18:11:40Z</dc:date>
    <item>
      <title>JSL-create subset data table with row selection defined by column value</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-create-subset-data-table-with-row-selection-defined-by/m-p/464565#M70904</link>
      <description>&lt;P&gt;Just started learning JSL , using JMP16&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Trying to write a script to create a subset data table with selected row, the selection critera are defined by numeric values in column(7).&lt;/P&gt;&lt;P&gt;The backbone of the following script is from "subset" run under the "Tables" tab.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Data Table( "Subset of 200 kinome all excel" ) &amp;lt;&amp;lt;
Subset(
	Linked,
	
	selected rows only(0),
	row selection (select where (as column(7) &amp;gt;0.3) );

	Selected columns only(0),
	
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The selection of the above script did not work. The subset table is identical to the original one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What did I miss?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 18:11:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-create-subset-data-table-with-row-selection-defined-by/m-p/464565#M70904</guid>
      <dc:creator>GroupSquareWolf</dc:creator>
      <dc:date>2023-06-09T18:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: JSL-create subset data table with row selection defined by column value</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-create-subset-data-table-with-row-selection-defined-by/m-p/464603#M70906</link>
      <description>&lt;P&gt;Edited code after&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/9474"&gt;@Georg&lt;/a&gt;&amp;nbsp;found my code in error.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have a&amp;nbsp; couple of small issues.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;The Selected Rows Only() needs to be turned on
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;selected rows only( 1 ),&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;The Select Where needs to be moved to being an independent statement
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Data Table( "Subset of 200 kinome all excel" ) &amp;lt;&amp;lt;
row selection( select where( As Column( 7 ) &amp;gt; 0.3 ) );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Here is the complete code&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Data Table( "Subset of 200 kinome all excel" ) &amp;lt;&amp;lt;
row selection( select where( As Column( 7 ) &amp;gt; 0.3 ) );
Data Table( "Subset of 200 kinome all excel" ) &amp;lt;&amp;lt;
Subset(
	Linked,
	selected rows only( 1 ),
	Selected columns only( 0 )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Feb 2022 11:11:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-create-subset-data-table-with-row-selection-defined-by/m-p/464603#M70906</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-02-26T11:11:04Z</dc:date>
    </item>
    <item>
      <title>Re: JSL-create subset data table with row selection defined by column value</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-create-subset-data-table-with-row-selection-defined-by/m-p/464633#M70912</link>
      <description>&lt;P&gt;I would not use this approach at all, and it doesn't work on my Computer (still all rows in subset, and no error/message thrown):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names default to here(1);

dt=open("$SAMPLE_DATA\Big Class.jmp");

Data Table( dt ) &amp;lt;&amp;lt; Subset(
	Linked, 
	selected rows only( 1 ),
	row selection( select where( As Column( 2 ) &amp;gt; 13 ) ), 
	Selected columns only( 0 ), 	
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The reason is, that in documentation of "subset" I couldn't find any option like "row selection", there is only&amp;nbsp;&lt;/P&gt;
&lt;PRE id="ww795793" class="code"&gt;&amp;lt;Selected Rows&amp;gt;, &amp;lt;Rows(&lt;SPAN class="argument"&gt;[number, number, ...]&lt;/SPAN&gt;)&amp;gt;,&lt;/PRE&gt;
&lt;P&gt;see:&amp;nbsp;&lt;A href="https://www.jmp.com/support/help/en/16.1/?os=win&amp;amp;source=application&amp;amp;utm_source=helpmenu&amp;amp;utm_medium=application#page/jmp/subset-a-data-table.shtml" target="_blank"&gt;Subset a Data Table (jmp.com)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;And the danger is, that unknown parameters don't thrown an error, so difficult to debug.&lt;/P&gt;
&lt;P&gt;Additionally, when selecting rows within that subset statement, I would't really be sure that selecting gets done before the subset, so it doesn't look stable to me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My solution would be either to select the rows before the subset statement, or as below by explicitly selecting the row numbers.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );

Data Table( dt ) &amp;lt;&amp;lt; Subset(
	Linked,
	rows( /* explicit rows [1,2,3] or conditionally: */ Loc( (dt:age &amp;lt;&amp;lt; get values) &amp;gt; 16 ) ),
	Selected columns only( 0 ),
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Feb 2022 10:13:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-create-subset-data-table-with-row-selection-defined-by/m-p/464633#M70912</guid>
      <dc:creator>Georg</dc:creator>
      <dc:date>2022-02-26T10:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: JSL-create subset data table with row selection defined by column value</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-create-subset-data-table-with-row-selection-defined-by/m-p/464653#M70918</link>
      <description>&lt;P&gt;Thank you for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Feb 2022 20:04:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-create-subset-data-table-with-row-selection-defined-by/m-p/464653#M70918</guid>
      <dc:creator>GroupSquareWolf</dc:creator>
      <dc:date>2022-02-26T20:04:33Z</dc:date>
    </item>
  </channel>
</rss>

