<?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 Get Row numbers ... where row just exists. That's all I want is just a list of rows in the table ie [1,2,3,4,5,6] in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Get-Row-numbers-where-row-just-exists-That-s-all-I-want-is-just/m-p/278136#M54024</link>
    <description>&lt;P&gt;I've got this GUI and I've got rows that I made&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I'm doing is using a row state handler to detect when someone selects mapped shapes in a graph.&lt;/P&gt;&lt;P&gt;That shows which rows they actually selected.&lt;/P&gt;&lt;P&gt;Now I have 2 helper "map shapes" in that graph as well. when they select something in the primary graph I need to highlight it in the helper graphs as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So this is my code, and I want selected to be live updated to be 1 or 2 so I can follow it up with another few lines that say:&lt;/P&gt;&lt;P&gt;get helper_rows that have the same keyname as the selected rows and select them too so the user knows they are related and I can then get them for a subset that is in my next step.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so my plan:&lt;/P&gt;&lt;P&gt;1. get list of all rows in table there has to be a better way than this...&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt; all_rownums = subset_JMP_Master_Table &amp;lt;&amp;lt; GetRowsWhere (:Name != -99999); &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;2. inside the row state handler: get selected rows&lt;/P&gt;&lt;P&gt;3. subtract the selected rows from the total row list? Get 2 lists: 1 that is selected rows, and the other that is rows that arent selected.&lt;/P&gt;&lt;P&gt;4. Assign selected flag as 1 or 2 to the selected column.&lt;/P&gt;&lt;P&gt;5. Lookup helper rows based on&amp;nbsp; keyname + selected column = 1&amp;nbsp;&lt;/P&gt;&lt;P&gt;6. select the helper rows as well and subset the whole thing for next steps.&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;PRE&gt; subset_JMP_Master_Table &amp;lt;&amp;lt; New Column( "selected", 
 Numeric
 , Ordinal
 ,set each value(0)
 );
 
 all_rownums = subset_JMP_Master_Table &amp;lt;&amp;lt; GetRowsWhere (:Name != -99999); 


//rows_in_subset_table = subset_JMP_Master_ Table &amp;lt;&amp;lt; Select All Rows;
//show(rows_in_subset_table);

select_sync_rsh = subset_JMP_Master_Table &amp;lt;&amp;lt; MakeRowStateHandler(
Function(
{a}


,if(

select_sync_script_on

,( //start doing things based on script

print(a);
r = subset_JMP_Master_Table &amp;lt;&amp;lt; get selected rows;
Column(subset_JMP_Master_Table, "selected")[r] = 1;
q = subset_JMP_Master_Table &amp;lt;&amp;lt; GetRowsWhere (:selected != 1); 
Column(subset_JMP_Master_Table, "selected")[q] = 2;


)//end doing things based on script


)// end if 
); //end function
);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 11 Jun 2023 11:03:29 GMT</pubDate>
    <dc:creator>xxvvcczz</dc:creator>
    <dc:date>2023-06-11T11:03:29Z</dc:date>
    <item>
      <title>Get Row numbers ... where row just exists. That's all I want is just a list of rows in the table ie [1,2,3,4,5,6]</title>
      <link>https://community.jmp.com/t5/Discussions/Get-Row-numbers-where-row-just-exists-That-s-all-I-want-is-just/m-p/278136#M54024</link>
      <description>&lt;P&gt;I've got this GUI and I've got rows that I made&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I'm doing is using a row state handler to detect when someone selects mapped shapes in a graph.&lt;/P&gt;&lt;P&gt;That shows which rows they actually selected.&lt;/P&gt;&lt;P&gt;Now I have 2 helper "map shapes" in that graph as well. when they select something in the primary graph I need to highlight it in the helper graphs as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So this is my code, and I want selected to be live updated to be 1 or 2 so I can follow it up with another few lines that say:&lt;/P&gt;&lt;P&gt;get helper_rows that have the same keyname as the selected rows and select them too so the user knows they are related and I can then get them for a subset that is in my next step.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so my plan:&lt;/P&gt;&lt;P&gt;1. get list of all rows in table there has to be a better way than this...&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt; all_rownums = subset_JMP_Master_Table &amp;lt;&amp;lt; GetRowsWhere (:Name != -99999); &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;2. inside the row state handler: get selected rows&lt;/P&gt;&lt;P&gt;3. subtract the selected rows from the total row list? Get 2 lists: 1 that is selected rows, and the other that is rows that arent selected.&lt;/P&gt;&lt;P&gt;4. Assign selected flag as 1 or 2 to the selected column.&lt;/P&gt;&lt;P&gt;5. Lookup helper rows based on&amp;nbsp; keyname + selected column = 1&amp;nbsp;&lt;/P&gt;&lt;P&gt;6. select the helper rows as well and subset the whole thing for next steps.&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;PRE&gt; subset_JMP_Master_Table &amp;lt;&amp;lt; New Column( "selected", 
 Numeric
 , Ordinal
 ,set each value(0)
 );
 
 all_rownums = subset_JMP_Master_Table &amp;lt;&amp;lt; GetRowsWhere (:Name != -99999); 


//rows_in_subset_table = subset_JMP_Master_ Table &amp;lt;&amp;lt; Select All Rows;
//show(rows_in_subset_table);

select_sync_rsh = subset_JMP_Master_Table &amp;lt;&amp;lt; MakeRowStateHandler(
Function(
{a}


,if(

select_sync_script_on

,( //start doing things based on script

print(a);
r = subset_JMP_Master_Table &amp;lt;&amp;lt; get selected rows;
Column(subset_JMP_Master_Table, "selected")[r] = 1;
q = subset_JMP_Master_Table &amp;lt;&amp;lt; GetRowsWhere (:selected != 1); 
Column(subset_JMP_Master_Table, "selected")[q] = 2;


)//end doing things based on script


)// end if 
); //end function
);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:03:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Get-Row-numbers-where-row-just-exists-That-s-all-I-want-is-just/m-p/278136#M54024</guid>
      <dc:creator>xxvvcczz</dc:creator>
      <dc:date>2023-06-11T11:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: Get Row numbers ... where row just exists. That's all I want is just a list of rows in the table ie [1,2,3,4,5,6]</title>
      <link>https://community.jmp.com/t5/Discussions/Get-Row-numbers-where-row-just-exists-That-s-all-I-want-is-just/m-p/278143#M54025</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;subset_JMP_Master_Table &amp;lt;&amp;lt; New Column( "selected", Numeric, Ordinal, set each value( 0 ) );

fhg = N Rows( subset_JMP_Master_Table );

all_rownums = subset_JMP_Master_Table &amp;lt;&amp;lt; GetRowsWhere( :Name != -99999 );

//rows_in_subset_table = subset_JMP_Master_ Table &amp;lt;&amp;lt; Select All Rows;
//show(rows_in_subset_table);

select_sync_rsh = subset_JMP_Master_Table &amp;lt;&amp;lt; MakeRowStateHandler(
    Function(
        {a}
    ,
        If( 
            select_sync_script_on
        ,
            (//start doing things based on script

            Print( a ) ; 

            subset_JMP_Master_Table:selected &amp;lt;&amp;lt; Set Each Value( 2 ) ; // just blanket set everything to 2
            curr_selected_rows = subset_JMP_Master_Table &amp;lt;&amp;lt; get selected rows ; // get the selected rows
            subset_JMP_Master_Table:selected[curr_selected_rows] = 1 ; //update the selected rows to 1

            )//end doing things based on script
        )// end if
    ); //end function
); //end row state handler
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2020 18:34:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Get-Row-numbers-where-row-just-exists-That-s-all-I-want-is-just/m-p/278143#M54025</guid>
      <dc:creator>xxvvcczz</dc:creator>
      <dc:date>2020-07-14T18:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: Get Row numbers ... where row just exists. That's all I want is just a list of rows in the table ie [1,2,3,4,5,6]</title>
      <link>https://community.jmp.com/t5/Discussions/Get-Row-numbers-where-row-just-exists-That-s-all-I-want-is-just/m-p/278151#M54026</link>
      <description>&lt;P&gt;I think you can get your rownum matrix with&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;subset_JMP_Master_Table=current data table();
all_rownums = index(1,nrows(subset_JMP_Master_Table));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 11 Jul 2020 19:20:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Get-Row-numbers-where-row-just-exists-That-s-all-I-want-is-just/m-p/278151#M54026</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-07-11T19:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Get Row numbers ... where row just exists. That's all I want is just a list of rows in the table ie [1,2,3,4,5,6]</title>
      <link>https://community.jmp.com/t5/Discussions/Get-Row-numbers-where-row-just-exists-That-s-all-I-want-is-just/m-p/278209#M54044</link>
      <description>&lt;P&gt;You can also use the syntax &lt;STRONG&gt;1::n&lt;/STRONG&gt; to produce a matrix:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;subset_JMP_Master_Table=current data table();
b = 1::nrows(subset_JMP_Master_Table);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 12 Jul 2020 11:33:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Get-Row-numbers-where-row-just-exists-That-s-all-I-want-is-just/m-p/278209#M54044</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2020-07-12T11:33:18Z</dc:date>
    </item>
  </channel>
</rss>

