removing {} from << get selected variablethe output below puts { } on the date_selection variable. How do I remove the brackets.
output = {"date1"};
desired output = "date1";
date_list = Column( 2 ) << get values;
Show( date_list );
run_select = New Window( "checkboxes",
<<MODAL></MODAL>Advanced Statistical ModelingRe: removing {} from << get selected variableThank you for this solution. Works just fine.
Had one question, what if the column names have '/' in them and don't work directly without using ":name(column name)" ? Any way of using ":name(column name)" instead of just "column name" ?
Thanks in Advance.
Re: removing {} from << get selected variableIt is not actually a date column. It is a list of column names which are all categorical. So when I say contact, I dont want to concat the column names. I want to contact the data in those columns together and make a new column out of it. So cannot use "concat Items" as I think it would concat the column names not their values.
Re: removing {} from << get selected variableThank you. This solved my query.
Re: removing {} from << get selected variableI'll always argue against Eval(Parse())
You can just do the concat items directly with << Set Each Value (so you don't need to have the variable set)
Names default to here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
myPlatform = New Window( "Filter Col Selector Example", << modal,
fontobj = lb = Filter Col Selector( width( 250 ) ),
button box("OK", date_selection=(lb<<GET selected=""></GET>
I wonder what you're actually doing with that column if it's really a list of dates, it might be worth just putting the list into a column as an expression column type. Depending on how you're using this column.
// using an expression column
dt << new column("FINALNEW_expression", expression, <<SETEACHVALUE></SETEACHVALUE>
Re: removing {} from << get selected variableI think this is the best way to handle the issue
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
date_selection = {"name", "sex"};<BR />
cString = concat items(date_selection, ",");
Eval( Parse( "dt << new column(\!"FINALNEW\!", Formula(Concat(" ||
cString || " ) ) );" ) );Re: removing {} from << get selected variableThe << get selected message returns a JMP list. JMP Lists are noted by the curly brackets { "A", "B", "C" }. Just like a JMP matrix is noted by square brackets [ 4, 3, 5 ].
Why do you want the curly brackets removed?
Re: removing {} from << get selected variableWhat if I want all the items in the list but without brackets. So something like this "Cats", "Dogs" instead of {"Cats", "Dogs"} ?
As in my case the list if the list of columns selected in a data filter. I want to use that list of columns in a formula column to concat the values in those list of columns.
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
myPlatform = New Window( "Filter Col Selector Example",
fontobj = lb = Filter Col Selector( width( 250 ) ),
button box("OK", date_selection=(lb<<GET selected=""></GET>Re: removing {} from << get selected variableHello
I have a follow up question on this. If I want all the items in the list instead of a single one and I dont want them in brackets similar to the above question. What can I do to get that?
If I try this, I get the first item only without brackets.
button box("OK",date_selection=(cb_list<<GET selected=""></GET>
If I try this, I get all the items but with brackets. I want all the items in cb_list but without the brackets.
button box("OK",date_selection=(cb_list<<GET selected=""></GET>
Re: removing {} from << get selected variableThanks @txnelson!!
that did the trick! the output is now a simple string as desired.
Re: removing {} from << get selected variableAll you need to do, is to set the value of the returned variable to being the subscript as you generate the variable.
button box("OK",date_selection=(cb_list<<GET selected=""></GET>
by specifying the date_selection this way, date_selection will be a just a plain numeric variable.
Re: removing {} from << get selected variableThanks @julian for the quick response! also thanks for letting me know my output is a List and not a simple string. this case the output selection will always be only 1, so a list is not needed.
when I use either date_selection[1] or subscript(date_selection,1) my output now looks like {{"date1"}}. Another set of brackets is added. I wanted to reduce the number of brackets, not add them. LOL! 
Re: removing {} from << get selected variableHi @HarryG,
When you send the message "<< get selected" to the checkbox cb_list, JMP will return a list of all the selected elements, which as you noticed is not equivalent to a simple text string (which is what the { } indicate). If you wish to access the just the text "date1," and that's the first element in the list date_selection, you can subscript the list either with brackets or the subscript function: date_selection[1] or subscript(date_selection,1). Both of these operations will return "date1" if that's the first element in your list.
I hope this helps!
@julian