<?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: With JSL, how to split a datatable by distinct values in a column? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/With-JSL-how-to-split-a-datatable-by-distinct-values-in-a-column/m-p/587253#M79270</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/46102"&gt;@Setsuna&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I believe you are looking for the 'By' option in Subset:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt = Open( "$Sample_data/big class.jmp" );

dtSubs = dt &amp;lt;&amp;lt; Subset( All rows, Selected columns only( 0 ), By( :age ) );

//dtSubs is a list of data table references:
dtSubs[1] &amp;lt;&amp;lt; Set Name("First table")&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 06 Jan 2023 13:46:08 GMT</pubDate>
    <dc:creator>ih</dc:creator>
    <dc:date>2023-01-06T13:46:08Z</dc:date>
    <item>
      <title>With JSL, how to split a datatable by distinct values in a column?</title>
      <link>https://community.jmp.com/t5/Discussions/With-JSL-how-to-split-a-datatable-by-distinct-values-in-a-column/m-p/587232#M79269</link>
      <description>&lt;P&gt;Hello, I'm a starter of JSL and I have a question :grinning_face:&lt;/img&gt;&lt;/P&gt;&lt;P&gt;For example, I have a data table, and I want to divide (subset) it into several data tables,&amp;nbsp;by the values of &lt;FONT color="#993300"&gt;B column&lt;/FONT&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;A  B  C       A  B  C       A  B  C
1  1  1  =&amp;gt;   1  1  1  AND  3  2  6
2  1  4       2  1  4       2  2  1
3  2  6                     5  2  3
2  2  1
5  2  3&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know how to Subset a data table, or how to select rows according to B values (Select Where), but I don't know how to get a list of all distinct values in column B (just like&amp;nbsp; SELECT DISTINCT statement in SQL) without go through all the rows.&lt;/P&gt;&lt;P&gt;What is the best way to do this work?&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 16:05:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/With-JSL-how-to-split-a-datatable-by-distinct-values-in-a-column/m-p/587232#M79269</guid>
      <dc:creator>Setsuna</dc:creator>
      <dc:date>2023-06-09T16:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: With JSL, how to split a datatable by distinct values in a column?</title>
      <link>https://community.jmp.com/t5/Discussions/With-JSL-how-to-split-a-datatable-by-distinct-values-in-a-column/m-p/587253#M79270</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/46102"&gt;@Setsuna&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I believe you are looking for the 'By' option in Subset:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt = Open( "$Sample_data/big class.jmp" );

dtSubs = dt &amp;lt;&amp;lt; Subset( All rows, Selected columns only( 0 ), By( :age ) );

//dtSubs is a list of data table references:
dtSubs[1] &amp;lt;&amp;lt; Set Name("First table")&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Jan 2023 13:46:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/With-JSL-how-to-split-a-datatable-by-distinct-values-in-a-column/m-p/587253#M79270</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2023-01-06T13:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: With JSL, how to split a datatable by distinct values in a column?</title>
      <link>https://community.jmp.com/t5/Discussions/With-JSL-how-to-split-a-datatable-by-distinct-values-in-a-column/m-p/587256#M79271</link>
      <description>&lt;P&gt;Thank you very much! That's exactly what I want.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2023 14:00:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/With-JSL-how-to-split-a-datatable-by-distinct-values-in-a-column/m-p/587256#M79271</guid>
      <dc:creator>Setsuna</dc:creator>
      <dc:date>2023-01-06T14:00:34Z</dc:date>
    </item>
  </channel>
</rss>

