<?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: Script command to check whether a selection criteria returns &amp;gt;0 selected rows in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Script-command-to-check-whether-a-selection-criteria-returns-gt/m-p/810360#M99285</link>
    <description>&lt;P&gt;doesn't look like a "solution"&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1731360209704.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/70058iE38FADE5326D3251/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1731360209704.png" alt="hogi_0-1731360209704.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 11 Nov 2024 21:23:45 GMT</pubDate>
    <dc:creator>hogi</dc:creator>
    <dc:date>2024-11-11T21:23:45Z</dc:date>
    <item>
      <title>Script command to check whether a selection criteria returns &gt;0 selected rows</title>
      <link>https://community.jmp.com/t5/Discussions/Script-command-to-check-whether-a-selection-criteria-returns-gt/m-p/810312#M99261</link>
      <description>&lt;P&gt;I'm looking for a scripting command that checks whether a selection contains &amp;gt;0 selected rows. The issue: subsetting a table of selected rows when none are selected, stops the script and returns an error message. I circumvent this problem by creating a column that sets selected rows to 1, then take col sum and run the if command (if col sum &amp;gt; 0, subset, don't subset). But that's clunky and for loops with sometimes &amp;gt;1mio repeats, adds significant time to the process. Are there more elegant solutions? For example, the number of selected rows appears in the data table (row module, usually in left bottom corner), meaning JMP does count the selected rows internally, somewhere. Is there a way to retrieve this number in the script?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2024 15:16:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-command-to-check-whether-a-selection-criteria-returns-gt/m-p/810312#M99261</guid>
      <dc:creator>Monomorphist</dc:creator>
      <dc:date>2024-11-11T15:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: Script command to check whether a selection criteria returns &gt;0 selected rows</title>
      <link>https://community.jmp.com/t5/Discussions/Script-command-to-check-whether-a-selection-criteria-returns-gt/m-p/810315#M99263</link>
      <description>&lt;P&gt;You can use &amp;lt;&amp;lt; Get Selected Rows and check the amount if items in the amtrix&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If(dt &amp;lt;&amp;lt; get selected rows &amp;lt; 1,
	stop();
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Nov 2024 15:31:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-command-to-check-whether-a-selection-criteria-returns-gt/m-p/810315#M99263</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-11-11T15:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: Script command to check whether a selection criteria returns &gt;0 selected rows</title>
      <link>https://community.jmp.com/t5/Discussions/Script-command-to-check-whether-a-selection-criteria-returns-gt/m-p/810322#M99269</link>
      <description>&lt;P&gt;Not quite, because "get selected rows" returns a list, not the number of selected rows. Still good idea! I get selected rows as list and can query the number of items in the list. Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2024 15:56:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-command-to-check-whether-a-selection-criteria-returns-gt/m-p/810322#M99269</guid>
      <dc:creator>Monomorphist</dc:creator>
      <dc:date>2024-11-11T15:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: Script command to check whether a selection criteria returns &gt;0 selected rows</title>
      <link>https://community.jmp.com/t5/Discussions/Script-command-to-check-whether-a-selection-criteria-returns-gt/m-p/810332#M99274</link>
      <description>&lt;P&gt;Yeah I did paste incorrect code, it was supposed to be wrapped in N Items() (N Rows and N Cols should also work, but N Items is the most clear)&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 rows(1::10);

If(N Items(dt &amp;lt;&amp;lt; get selected rows) &amp;lt; 1,
	Show("stop1");
	stop();
);


show("continue1");


dt &amp;lt;&amp;lt; clear select;
If(N Items(dt &amp;lt;&amp;lt; get selected rows) &amp;lt; 1,
	Show("stop2");
	stop();
);

show("continue2");
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2024 16:46:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-command-to-check-whether-a-selection-criteria-returns-gt/m-p/810332#M99274</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-11-11T16:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: Script command to check whether a selection criteria returns &gt;0 selected rows</title>
      <link>https://community.jmp.com/t5/Discussions/Script-command-to-check-whether-a-selection-criteria-returns-gt/m-p/810360#M99285</link>
      <description>&lt;P&gt;doesn't look like a "solution"&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1731360209704.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/70058iE38FADE5326D3251/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1731360209704.png" alt="hogi_0-1731360209704.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2024 21:23:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-command-to-check-whether-a-selection-criteria-returns-gt/m-p/810360#M99285</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-11-11T21:23:45Z</dc:date>
    </item>
  </channel>
</rss>

