Hi there,
Maybe you can help me figure out what I am doing wrong here.
I have the following toy data table:
![kachveder_2-1631473405906.png kachveder_2-1631473405906.png](https://community.jmp.com/t5/image/serverpage/image-id/35723iB851318E5DC08A9A/image-size/medium?v=v2&px=400)
I have been having some trouble with refining a list of character column names becoming from the following script.
//get unique column names
cols = Current Data Table() << getColumnNames(Character);
//del columns I don't want
DELCOLS = {"Column 5", "Column 6"};
unique_col_names = Associative Array(cols) << Remove(Associative Array(DELCOLS)) << get keys;
//make a pop-up window
nw = New Window( "Set a Value",
<<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 << get selected});
nw << close window;
),
Button Box( "Cancel")
),
//change popup window size
<<Size Window(200,200)
);
What I am getting is the following in the resulting modal pop-up window.
![kachveder_0-1631473290010.png kachveder_0-1631473290010.png](https://community.jmp.com/t5/image/serverpage/image-id/35721iBB2A127FC4D312CA/image-size/medium?v=v2&px=400)
I want the following pop-up window only to have the following:
![kachveder_1-1631473303846.png kachveder_1-1631473303846.png](https://community.jmp.com/t5/image/serverpage/image-id/35722i3DD5FE76688A494F/image-size/medium?v=v2&px=400)
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.
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.
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.
- removing elements from a list remove elements in a list
- getting the column name from the column number and inputting the columns I selected into a list to be used. How to get column number from column name? (JMP)
I have attached the toy dataset file which includes the script that I have referenced above.