<?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 do i invert Unhide and unexclude rows  based on values in few columns in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/how-do-i-invert-Unhide-and-unexclude-rows-based-on-values-in-few/m-p/63494#M34014</link>
    <description>&lt;P&gt;CG, I attached a data table, named PerChangeExample to emulate your example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this script&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);

dt = Data Table("PerChangeExample");
dt &amp;lt;&amp;lt; select where(:Per_change &amp;lt; 0 | IsMissing(:Per_change) );
dt &amp;lt;&amp;lt; exclude(1) &amp;lt;&amp;lt; hide(1);
dt &amp;lt;&amp;lt; select where(:Step &amp;lt; 0 | IsMissing(:Step) );
dt &amp;lt;&amp;lt; exclude(1) &amp;lt;&amp;lt; hide(1);
dt &amp;lt;&amp;lt; clear select;

nexcl = nrow( dt &amp;lt;&amp;lt; get excluded rows() );
if ( nrow(dt) - nexcl &amp;lt; 8,
   for(i = nexcl, i &amp;gt; nrow(dt) -8 , i--,
      if ( !IsMissing(:Step[i]), 
            dt &amp;lt;&amp;lt; Select Rows(i);
            dt &amp;lt;&amp;lt; Exclude(0) &amp;lt;&amp;lt; Hide(0);
            dt &amp;lt;&amp;lt; clear select;
         )
    ); //end for i 
); // end if

nexcl = nrow( dt &amp;lt;&amp;lt; get excluded rows() );
if ( nrow(dt) - nexcl &amp;lt; 8, throw() ); //stop program execution if still not enough data.&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 20 Jul 2018 08:12:15 GMT</pubDate>
    <dc:creator>gzmorgan0</dc:creator>
    <dc:date>2018-07-20T08:12:15Z</dc:date>
    <item>
      <title>how do i invert Unhide and unexclude rows  based on values in few columns</title>
      <link>https://community.jmp.com/t5/Discussions/how-do-i-invert-Unhide-and-unexclude-rows-based-on-values-in-few/m-p/63488#M34011</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I need some guidance here....&lt;/P&gt;&lt;P&gt;I have two columns (per_Change) and Step (it's a formula based values) and Per_Change column is sorted from -ve to +ve values.&lt;/P&gt;&lt;P&gt;In my script i need to know max rows so i created rank column from 1-14 (ascending order as attached image) and need to have atleast 8 rows (starting with highest rank).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Steps:&lt;/P&gt;&lt;P&gt;1. Exclude -ve values in Per_Change column&lt;/P&gt;&lt;P&gt;2. then in Col Step is based on some formula, and it will create some "-ve" and "+ve" and some "null" values. Hide and exclude all -ve values in col Step. the null values were already hidden and excluded based on Col Per_Change since formula will generate -ve values.&lt;/P&gt;&lt;P&gt;3. My requirement is to have atleast 8 values (descending order). In my example there are 6 clear row states (rank 9-14)&amp;nbsp; (2 additional rows should be from descending i.e. unhide/unexclude rank 8 and 7 but should not include "null" values in a scenario if there are more null values and fewer -ve or +ve values in col Step).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step 1 and 2, i am able to perform in JSL script but am having issues in enabling 2 additional rows.&lt;/P&gt;&lt;P&gt;I tried using lag function and also creating dummy columns to go enabling in reverse order but am having hard time for unselecting additional rows.&lt;/P&gt;&lt;P&gt;.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Datatable.PNG" style="width: 406px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/11622i398E80669C3969FC/image-size/large?v=v2&amp;amp;px=999" role="button" title="Datatable.PNG" alt="Datatable.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jul 2018 03:35:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-do-i-invert-Unhide-and-unexclude-rows-based-on-values-in-few/m-p/63488#M34011</guid>
      <dc:creator>CG</dc:creator>
      <dc:date>2018-07-20T03:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: how do i invert Unhide and unexclude rows  based on values in few columns</title>
      <link>https://community.jmp.com/t5/Discussions/how-do-i-invert-Unhide-and-unexclude-rows-based-on-values-in-few/m-p/63494#M34014</link>
      <description>&lt;P&gt;CG, I attached a data table, named PerChangeExample to emulate your example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this script&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);

dt = Data Table("PerChangeExample");
dt &amp;lt;&amp;lt; select where(:Per_change &amp;lt; 0 | IsMissing(:Per_change) );
dt &amp;lt;&amp;lt; exclude(1) &amp;lt;&amp;lt; hide(1);
dt &amp;lt;&amp;lt; select where(:Step &amp;lt; 0 | IsMissing(:Step) );
dt &amp;lt;&amp;lt; exclude(1) &amp;lt;&amp;lt; hide(1);
dt &amp;lt;&amp;lt; clear select;

nexcl = nrow( dt &amp;lt;&amp;lt; get excluded rows() );
if ( nrow(dt) - nexcl &amp;lt; 8,
   for(i = nexcl, i &amp;gt; nrow(dt) -8 , i--,
      if ( !IsMissing(:Step[i]), 
            dt &amp;lt;&amp;lt; Select Rows(i);
            dt &amp;lt;&amp;lt; Exclude(0) &amp;lt;&amp;lt; Hide(0);
            dt &amp;lt;&amp;lt; clear select;
         )
    ); //end for i 
); // end if

nexcl = nrow( dt &amp;lt;&amp;lt; get excluded rows() );
if ( nrow(dt) - nexcl &amp;lt; 8, throw() ); //stop program execution if still not enough data.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Jul 2018 08:12:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-do-i-invert-Unhide-and-unexclude-rows-based-on-values-in-few/m-p/63494#M34014</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2018-07-20T08:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: how do i invert Unhide and unexclude rows  based on values in few columns</title>
      <link>https://community.jmp.com/t5/Discussions/how-do-i-invert-Unhide-and-unexclude-rows-based-on-values-in-few/m-p/63535#M34032</link>
      <description>&lt;P&gt;Thank you for prompt reply...it works!&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jul 2018 16:40:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-do-i-invert-Unhide-and-unexclude-rows-based-on-values-in-few/m-p/63535#M34032</guid>
      <dc:creator>CG</dc:creator>
      <dc:date>2018-07-20T16:40:14Z</dc:date>
    </item>
  </channel>
</rss>

