<?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: select a row then reselect Scriptiing in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/select-a-row-then-reselect-Scriptiing/m-p/535250#M75761</link>
    <description>&lt;P&gt;I think you should have all rows selected based on your script because s contains all values from Letter column, not just those which match number 2's letter and then you check if current rows letter is in that list (it always is).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are many ways to do what you want. Here is the method I would most likely use ( &lt;LI-MESSAGE title="Data table subscripting" uid="21013" url="https://community.jmp.com/t5/Uncharted/Data-table-subscripting/m-p/21013#U21013" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-blog-thread lia-fa-icon lia-fa-blog lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt; :(&lt;/img&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = New Table("Untitled",
	Add Rows(6),
	New Column("Letter", Character, "Nominal", Set Values({"A", "A", "A", "B", "B", "B"})),
	New Column("Number", Numeric, "Continuous", Format("Best", 12), Set Values([1, 2, 3, 4, 5, 6]))
);

num_rows = dt &amp;lt;&amp;lt; Get Rows Where(:Number == 2);
show(num_rows);
letters_of_interest = dt[num_rows, "Letter"];
show(letters_of_interest);
dt &amp;lt;&amp;lt; Select Where(Contains(letters_of_interest, :Letter));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You could also use &amp;lt;&amp;lt; Select Where in combination with &amp;lt;&amp;lt; Get Selected Rows (one example&lt;LI-MESSAGE title="get values from select where" uid="274877" url="https://community.jmp.com/t5/Discussions/get-values-from-select-where/m-p/274877#U274877" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt; )&lt;/P&gt;</description>
    <pubDate>Thu, 18 Aug 2022 17:25:03 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2022-08-18T17:25:03Z</dc:date>
    <item>
      <title>select a row then reselect Scriptiing</title>
      <link>https://community.jmp.com/t5/Discussions/select-a-row-then-reselect-Scriptiing/m-p/535231#M75760</link>
      <description>&lt;P&gt;In this sample table, I am trying to select the row that has a value of 2 in &lt;STRONG&gt;:Number&lt;/STRONG&gt;, grab the value "A" from &lt;STRONG&gt;:Letter,&lt;/STRONG&gt; then select all the rows contains "A" in &lt;STRONG&gt;:Letter&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GroupSquareWolf_0-1660841747549.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/44854iC7077DC043FD7B70/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GroupSquareWolf_0-1660841747549.png" alt="GroupSquareWolf_0-1660841747549.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GroupSquareWolf_1-1660841769559.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/44855i1883C05CF3AF52F5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GroupSquareWolf_1-1660841769559.png" alt="GroupSquareWolf_1-1660841769559.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrote this script but it is not working.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt= current datatable();
dt &amp;lt;&amp;lt;select where (:"Number" == 2);

s=Column(dt, "Letter")&amp;lt;&amp;lt;get Values;

show (s);

dt&amp;lt;&amp;lt;select where(contains(s,:"Letter"));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;looking at the log&amp;nbsp;&lt;/P&gt;&lt;P&gt;s = {"A", "A", "A", "B", "B", "B"};&lt;/P&gt;&lt;P&gt;And no rows were selected at the end of the script.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What went wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&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;</description>
      <pubDate>Fri, 09 Jun 2023 17:08:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/select-a-row-then-reselect-Scriptiing/m-p/535231#M75760</guid>
      <dc:creator>GroupSquareWolf</dc:creator>
      <dc:date>2023-06-09T17:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: select a row then reselect Scriptiing</title>
      <link>https://community.jmp.com/t5/Discussions/select-a-row-then-reselect-Scriptiing/m-p/535250#M75761</link>
      <description>&lt;P&gt;I think you should have all rows selected based on your script because s contains all values from Letter column, not just those which match number 2's letter and then you check if current rows letter is in that list (it always is).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are many ways to do what you want. Here is the method I would most likely use ( &lt;LI-MESSAGE title="Data table subscripting" uid="21013" url="https://community.jmp.com/t5/Uncharted/Data-table-subscripting/m-p/21013#U21013" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-blog-thread lia-fa-icon lia-fa-blog lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt; :(&lt;/img&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = New Table("Untitled",
	Add Rows(6),
	New Column("Letter", Character, "Nominal", Set Values({"A", "A", "A", "B", "B", "B"})),
	New Column("Number", Numeric, "Continuous", Format("Best", 12), Set Values([1, 2, 3, 4, 5, 6]))
);

num_rows = dt &amp;lt;&amp;lt; Get Rows Where(:Number == 2);
show(num_rows);
letters_of_interest = dt[num_rows, "Letter"];
show(letters_of_interest);
dt &amp;lt;&amp;lt; Select Where(Contains(letters_of_interest, :Letter));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You could also use &amp;lt;&amp;lt; Select Where in combination with &amp;lt;&amp;lt; Get Selected Rows (one example&lt;LI-MESSAGE title="get values from select where" uid="274877" url="https://community.jmp.com/t5/Discussions/get-values-from-select-where/m-p/274877#U274877" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt; )&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2022 17:25:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/select-a-row-then-reselect-Scriptiing/m-p/535250#M75761</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-08-18T17:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: select a row then reselect Scriptiing</title>
      <link>https://community.jmp.com/t5/Discussions/select-a-row-then-reselect-Scriptiing/m-p/535255#M75762</link>
      <description>&lt;P&gt;Thank you. I certainly missed the "Get Rows part"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I came up with this script after a bit of digging&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt= current datatable();
dt &amp;lt;&amp;lt;Row Selection(select where (:"Number" == 2));

s= (dt:"Letter"[dt &amp;lt;&amp;lt; get selected rows]);
show (s);

dt&amp;lt;&amp;lt;Row Selection (select where(contains(s,:"Letter")));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Aug 2022 17:29:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/select-a-row-then-reselect-Scriptiing/m-p/535255#M75762</guid>
      <dc:creator>GroupSquareWolf</dc:creator>
      <dc:date>2022-08-18T17:29:24Z</dc:date>
    </item>
  </channel>
</rss>

