<?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 Help needed in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Help-needed/m-p/972739#M110575</link>
    <description>&lt;P&gt;Hi all,&lt;BR /&gt;I am writing a script where I select a subset from a data table based on some criteria:&lt;BR /&gt;Example dt is my data table with column :Error_ID&lt;BR /&gt;I input: "dt_subset=dt&amp;lt;&amp;lt;select where (:Error_ID==0)&amp;lt;&amp;lt;subset(selected rows(1));" and I expect the dt_subset table to be filled by all the entries in the dt table where the column :Error_ID is 0.&lt;BR /&gt;Now let us say the dt data table has no Error_ID==0 rows, the dt_subset is empty.&lt;BR /&gt;I would have expected an dt_subset to be a new data table with the same columns as table dt but 0 rows, so that if I then check whether "If( !Empty(dt_subset)...)" I get a false and I do not continue doing work on the empty dt_subset table.&lt;BR /&gt;Instead I get an error if I try to check the if dt_subset is empty.&lt;BR /&gt;Basically what I want to do is be able to check if the selection is empty. Do you have a solution?&lt;BR /&gt;Thank you for your help!&lt;/P&gt;</description>
    <pubDate>Tue, 22 Sep 2026 07:53:45 GMT</pubDate>
    <dc:creator>Irenicon</dc:creator>
    <dc:date>2026-09-22T07:53:45Z</dc:date>
    <item>
      <title>Help needed</title>
      <link>https://community.jmp.com/t5/Discussions/Help-needed/m-p/972739#M110575</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;I am writing a script where I select a subset from a data table based on some criteria:&lt;BR /&gt;Example dt is my data table with column :Error_ID&lt;BR /&gt;I input: "dt_subset=dt&amp;lt;&amp;lt;select where (:Error_ID==0)&amp;lt;&amp;lt;subset(selected rows(1));" and I expect the dt_subset table to be filled by all the entries in the dt table where the column :Error_ID is 0.&lt;BR /&gt;Now let us say the dt data table has no Error_ID==0 rows, the dt_subset is empty.&lt;BR /&gt;I would have expected an dt_subset to be a new data table with the same columns as table dt but 0 rows, so that if I then check whether "If( !Empty(dt_subset)...)" I get a false and I do not continue doing work on the empty dt_subset table.&lt;BR /&gt;Instead I get an error if I try to check the if dt_subset is empty.&lt;BR /&gt;Basically what I want to do is be able to check if the selection is empty. Do you have a solution?&lt;BR /&gt;Thank you for your help!&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2026 07:53:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-needed/m-p/972739#M110575</guid>
      <dc:creator>Irenicon</dc:creator>
      <dc:date>2026-09-22T07:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed</title>
      <link>https://community.jmp.com/t5/Discussions/Help-needed/m-p/972750#M110576</link>
      <description>&lt;P&gt;If you just wish to check if any rows are selected, you can use &lt;EM&gt;&amp;lt;&amp;lt; Get Selected Rows&lt;/EM&gt;&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(:age &amp;gt;= 20);
selrows = dt &amp;lt;&amp;lt; Get Selected Rows;

If(N Items(selrows) == 0,
	Throw("No rows selected");
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;When I still need empty table after such a filter, I generally do something like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 

dt = open("$SAMPLE_DATA/Big Class.jmp");
rows_of_interest = dt &amp;lt;&amp;lt; Get Rows Where(:age &amp;gt;= 20);

If(N Items(rows_of_interest) &amp;gt; 0,
	dt_subset = dt &amp;lt;&amp;lt; Subset(Rows(rows_of_interest), Selected Columns(0), Output table("SUBSET"));
,
	dt_subset = dt &amp;lt;&amp;lt; Subset(Rows(1), Selected Columns(0), Output table("SUBSET"));
	dt_subset &amp;lt;&amp;lt; Delete Rows(1);
);

Show(N Rows(dt_subset)); // demo purposes&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you wish to check from the table which was not created&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_subset = dt &amp;lt;&amp;lt; Select Where(:age &amp;gt;= 20) &amp;lt;&amp;lt; Subset(Selected Rows(1), Selected Columns(0), Output table("SUBSET"));

If(Is Empty(dt_subset),
	Throw("No rows selected");
);

Write();&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Sep 2026 08:11:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-needed/m-p/972750#M110576</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2026-09-22T08:11:57Z</dc:date>
    </item>
  </channel>
</rss>

