<?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: From a Selection of Column Names, how do I modify the resulting column name list in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/From-a-Selection-of-Column-Names-how-do-I-modify-the-resulting/m-p/417526#M66663</link>
    <description>&lt;P&gt;Here is the way I would solve this issue&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

//get unique column names
cols = Current Data Table() &amp;lt;&amp;lt; getColumnNames( Character, string );
//del columns I don't want
DELCOLS = {"Column 5", "Column 6"};
For( i = 1, i &amp;lt;= N Items( DELCOLS ), i++,
	Try( Remove From( cols, Contains( cols, DELCOLS[i] ) ) )
);
unique_col_names = cols;

//make a pop-up window
nw = New Window( "Set a Value",
	&amp;lt;&amp;lt;Modal,
	Text Box( "Set the character variable:" ),
	variablebox1_col_name = Radio Box( unique_col_names ),
	H List Box(
//get all saved variable values when the user 
		//selects the OK button from the menu
		Button Box( "OK", answers = selected_var = variablebox1_col_name &amp;lt;&amp;lt; get selected ),
		Button Box( "Cancel" )
	)	
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 13 Sep 2021 02:19:27 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2021-09-13T02:19:27Z</dc:date>
    <item>
      <title>From a Selection of Column Names, how do I modify the resulting column name list</title>
      <link>https://community.jmp.com/t5/Discussions/From-a-Selection-of-Column-Names-how-do-I-modify-the-resulting/m-p/417508#M66661</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe you can help me figure out what I am doing wrong here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have the following toy data table:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kachveder_2-1631473405906.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/35723iB851318E5DC08A9A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kachveder_2-1631473405906.png" alt="kachveder_2-1631473405906.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;I have been having some trouble with refining a list of character column names becoming from the following script.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//get unique column names
cols = Current Data Table() &amp;lt;&amp;lt; getColumnNames(Character);
//del columns I don't want
DELCOLS = {"Column 5", "Column 6"};
unique_col_names = Associative Array(cols) &amp;lt;&amp;lt; Remove(Associative Array(DELCOLS)) &amp;lt;&amp;lt; get keys;

//make a pop-up window
nw = New Window( "Set a Value",
&amp;lt;&amp;lt;Modal,
Text Box("Set the character variable:"), 
variablebox1_col_name = Radio Box( unique_col_names ),
H List Box(
//get all saved variable values when the user 
//selects the OK button from the menu
Button Box( "OK", 
	answers = Eval List({selected_var = variablebox1_col_name &amp;lt;&amp;lt; get selected});
	nw &amp;lt;&amp;lt; close window;
),
Button Box( "Cancel")
), 

//change popup window size
&amp;lt;&amp;lt;Size Window(200,200)

	
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I am getting is the following in the resulting modal pop-up window.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kachveder_0-1631473290010.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/35721iBB2A127FC4D312CA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kachveder_0-1631473290010.png" alt="kachveder_0-1631473290010.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want the following pop-up window only to have the following:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kachveder_1-1631473303846.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/35722i3DD5FE76688A494F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kachveder_1-1631473303846.png" alt="kachveder_1-1631473303846.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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think my problem may have to do with a gap in my knowledge of associative arrays that I am having some trouble understanding completely, even though what the JMP scripting guide says about associative array keys and the remove from, remove, loc, and contains functions make sense.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to make sure that the columns that are left in the resulting list that I used in the model window can be renamed by the user in the original dataset, so the column names that I want to remove will stay the same. Also, the arrangement of the columns in the data table is the same, but the associative array rearranges the values in ascending order.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used the following methods already, according to these forums, and there must be something that I am not seeing here because I am new to the JSL language.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-&amp;nbsp;removing elements from a list&amp;nbsp;&lt;LI-MESSAGE title="remove elements in a list" uid="50865" url="https://community.jmp.com/t5/Discussions/remove-elements-in-a-list/m-p/50865#U50865" 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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- getting the column name from the column number and inputting the columns I selected into a list to be used.&amp;nbsp;&lt;LI-MESSAGE title="How to get column number from column name? (JMP)" uid="5987" url="https://community.jmp.com/t5/Discussions/How-to-get-column-number-from-column-name-JMP/m-p/5987#U5987" 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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have attached the toy dataset file which includes the script that I have referenced above.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:36:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/From-a-Selection-of-Column-Names-how-do-I-modify-the-resulting/m-p/417508#M66661</guid>
      <dc:creator>kachveder</dc:creator>
      <dc:date>2023-06-10T23:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: From a Selection of Column Names, how do I modify the resulting column name list</title>
      <link>https://community.jmp.com/t5/Discussions/From-a-Selection-of-Column-Names-how-do-I-modify-the-resulting/m-p/417526#M66663</link>
      <description>&lt;P&gt;Here is the way I would solve this issue&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

//get unique column names
cols = Current Data Table() &amp;lt;&amp;lt; getColumnNames( Character, string );
//del columns I don't want
DELCOLS = {"Column 5", "Column 6"};
For( i = 1, i &amp;lt;= N Items( DELCOLS ), i++,
	Try( Remove From( cols, Contains( cols, DELCOLS[i] ) ) )
);
unique_col_names = cols;

//make a pop-up window
nw = New Window( "Set a Value",
	&amp;lt;&amp;lt;Modal,
	Text Box( "Set the character variable:" ),
	variablebox1_col_name = Radio Box( unique_col_names ),
	H List Box(
//get all saved variable values when the user 
		//selects the OK button from the menu
		Button Box( "OK", answers = selected_var = variablebox1_col_name &amp;lt;&amp;lt; get selected ),
		Button Box( "Cancel" )
	)	
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Sep 2021 02:19:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/From-a-Selection-of-Column-Names-how-do-I-modify-the-resulting/m-p/417526#M66663</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-09-13T02:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: From a Selection of Column Names, how do I modify the resulting column name list</title>
      <link>https://community.jmp.com/t5/Discussions/From-a-Selection-of-Column-Names-how-do-I-modify-the-resulting/m-p/417864#M66701</link>
      <description>&lt;P&gt;Thanks so much! It worked great in my project and I learned what the Try() function is too.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2021 19:27:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/From-a-Selection-of-Column-Names-how-do-I-modify-the-resulting/m-p/417864#M66701</guid>
      <dc:creator>kachveder</dc:creator>
      <dc:date>2021-09-13T19:27:45Z</dc:date>
    </item>
  </channel>
</rss>

