<?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 proceed after selecting something from a combo box? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-proceed-after-selecting-something-from-a-combo-box/m-p/733533#M91491</link>
    <description>&lt;P&gt;You need slight modifications to your script:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;You need to use list to input values to &lt;A href="https://www.jmp.com/support/help/en/17.2/#page/jmp/construct-display-boxes-for-new-windows.shtml#ww634710" target="_blank" rel="noopener"&gt;combo box&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;You should get the value which was selected by user (usually within OK button) using &amp;lt;&amp;lt; get selected&lt;/LI&gt;
&lt;LI&gt;You should perform the check dynamically based on the user selection in your Select Where statement&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/47878"&gt;@mmarchandTSI&lt;/a&gt; answer already has answer for these problems so I provide a bit different solution in which you get the values based on your fruit column to the combo box, demonstrate how to set specific fruit and use &amp;lt;&amp;lt; get rows where instead of select where&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = New Table("Untitled",
	Add Rows(5),
	Compress File When Saved(1),
	New Column("fruit",
		Character,
		"Nominal",
		Set Values({"apple", "Mango", "Banana", "apple", "Banana", "Kiwi"})
	)
);
Summarize(dt, fruits = By(:fruit));

nw = New Window("Select fruit",
	cb_fruits = Combo Box(fruits),
	Button Box("OK",
		sel_fruit = cb_fruits &amp;lt;&amp;lt; get selected;
		nok_fruit_rows = dt &amp;lt;&amp;lt; Get Rows Where(:fruit != sel_fruit);
		dt &amp;lt;&amp;lt; Delete Rows(nok_fruit_rows); // note that fruits variable isn't updated
		nw &amp;lt;&amp;lt; Close Window; 
	),
	cb_fruits &amp;lt;&amp;lt; Set(Contains(fruits, "Kiwi"));
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 12 Mar 2024 20:06:20 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2024-03-12T20:06:20Z</dc:date>
    <item>
      <title>How do I proceed after selecting something from a combo box?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-proceed-after-selecting-something-from-a-combo-box/m-p/730241#M91305</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt; //fruit is a row in my table
 nw = New window ("Select fruit",
 cb = combo box ("apple", "Mango", "Banana")
 cb &amp;lt;&amp;lt; Set Selected,
 &amp;lt;&amp;lt; Set Width (20),
 //Here I select apple
 Button Box ("OK",
 	table1 &amp;lt;&amp;lt; SelectWhere(:fruit!=apple) &amp;lt;&amp;lt; Delete Rows;
 ) )&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;How do I proceed with the analyses by only selecting data corresponding to 'apple'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what I want from this code:&lt;/P&gt;&lt;P&gt;1, I first make a combo box&lt;/P&gt;&lt;P&gt;2. Select apple from the combo box&lt;/P&gt;&lt;P&gt;3. Once I click "OK" I should have the other rows deleted and only rows with apple left.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2024 13:27:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-proceed-after-selecting-something-from-a-combo-box/m-p/730241#M91305</guid>
      <dc:creator>GgGgGg2024</dc:creator>
      <dc:date>2024-03-06T13:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do I proceed after selecting something from a combo box?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-proceed-after-selecting-something-from-a-combo-box/m-p/730287#M91308</link>
      <description>&lt;P&gt;You could do something like this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;table1 = New Table( "Kind of Fruity",
	Add Rows( 6 ),
	New Column( "fruit", Character, "Nominal", Set Values( {"Apple", "Banana", "Mango", "Apple", "Apple", "Banana"} ) ),
	New Column( "Condiment",
		Character,
		"Nominal",
		Set Values( {"Peanut Butter", "Ketchup", "Cayenne Pepper", "Chocolate Fudge", "Caramel", "Salt"} )
	)
);
nw = New Window( "Select fruit",
	cb = Combo Box( {"Apple", "Mango", "Banana"} ),
	Button Box( "OK",
		table1 &amp;lt;&amp;lt; Delete Rows( table1 &amp;lt;&amp;lt; Get Rows Where( :fruit != (cb &amp;lt;&amp;lt; Get Selected) ) );
		nw &amp;lt;&amp;lt; Close Window;
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Mar 2024 15:38:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-proceed-after-selecting-something-from-a-combo-box/m-p/730287#M91308</guid>
      <dc:creator>mmarchandTSI</dc:creator>
      <dc:date>2024-03-06T15:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do I proceed after selecting something from a combo box?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-proceed-after-selecting-something-from-a-combo-box/m-p/733533#M91491</link>
      <description>&lt;P&gt;You need slight modifications to your script:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;You need to use list to input values to &lt;A href="https://www.jmp.com/support/help/en/17.2/#page/jmp/construct-display-boxes-for-new-windows.shtml#ww634710" target="_blank" rel="noopener"&gt;combo box&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;You should get the value which was selected by user (usually within OK button) using &amp;lt;&amp;lt; get selected&lt;/LI&gt;
&lt;LI&gt;You should perform the check dynamically based on the user selection in your Select Where statement&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/47878"&gt;@mmarchandTSI&lt;/a&gt; answer already has answer for these problems so I provide a bit different solution in which you get the values based on your fruit column to the combo box, demonstrate how to set specific fruit and use &amp;lt;&amp;lt; get rows where instead of select where&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = New Table("Untitled",
	Add Rows(5),
	Compress File When Saved(1),
	New Column("fruit",
		Character,
		"Nominal",
		Set Values({"apple", "Mango", "Banana", "apple", "Banana", "Kiwi"})
	)
);
Summarize(dt, fruits = By(:fruit));

nw = New Window("Select fruit",
	cb_fruits = Combo Box(fruits),
	Button Box("OK",
		sel_fruit = cb_fruits &amp;lt;&amp;lt; get selected;
		nok_fruit_rows = dt &amp;lt;&amp;lt; Get Rows Where(:fruit != sel_fruit);
		dt &amp;lt;&amp;lt; Delete Rows(nok_fruit_rows); // note that fruits variable isn't updated
		nw &amp;lt;&amp;lt; Close Window; 
	),
	cb_fruits &amp;lt;&amp;lt; Set(Contains(fruits, "Kiwi"));
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Mar 2024 20:06:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-proceed-after-selecting-something-from-a-combo-box/m-p/733533#M91491</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-03-12T20:06:20Z</dc:date>
    </item>
  </channel>
</rss>

