- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Restricting Col List Box entries
I have a problem with Col List Box. I'd like to restrict the list of columns available to be selected.
I've already restricted it to Numeric and Continuous, but in my application that leaves a very long list.
For that matter, if there is another way that's easier (Column Dialog?), that would be fine too. The documentation seems limited on this. For instance, it shows that a script can be added to the Col List Box() function, but does not have an example, or describe how that would be done.
Using a modified example from the Scripting Index, how would I, for example, remove all column names that start with an N?
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Semiconductor Capability.jmp" );
New Window( "Col List Box Example 3",
H List Box(
ll1 = Col List Box( all,
<< Set Data Type( "Numeric" ),
<< Set Analysis Type( "Continuous" )),
Button Box( "Add", ll2 << append( ll1 << get selected ) ),
ll2 = Col List Box( "numeric", MaxItems( 1 ), nlines( 1 ) ),
Button Box( "Remove", ll2 << remove selected )
)
);
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Restricting Col List Box entries
How about something like this ?
dt = Open( "$SAMPLE_DATA/Semiconductor Capability.jmp" );
ColumnNames = dt << Get Column Names("String");
for(i = N Items(ColumnNames), i >= 1 , i--,
If(!IsMissing(Regex(Char(ColumnNames[i]),"PNP*")),
Remove From(ColumnNames,i);
);
);
ColumnNames;
New Window( "Example", b = Button Box( "Popup Menu", Print( b << Get Menu Choice ) ) );
b << set menu items(ColumnNames);
Uday
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Restricting Col List Box entries
Check out filter col selector().
Names default to here(1);
dt = open("$SAMPLE_DATA\Big Class.jmp");
new window("Test",
fcs = filter col selector(dt)
);
It gives you a lot of options for reduction.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Restricting Col List Box entries
How about something like this ?
dt = Open( "$SAMPLE_DATA/Semiconductor Capability.jmp" );
ColumnNames = dt << Get Column Names("String");
for(i = N Items(ColumnNames), i >= 1 , i--,
If(!IsMissing(Regex(Char(ColumnNames[i]),"PNP*")),
Remove From(ColumnNames,i);
);
);
ColumnNames;
New Window( "Example", b = Button Box( "Popup Menu", Print( b << Get Menu Choice ) ) );
b << set menu items(ColumnNames);
Uday
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Restricting Col List Box entries
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Restricting Col List Box entries
Check out filter col selector().
Names default to here(1);
dt = open("$SAMPLE_DATA\Big Class.jmp");
new window("Test",
fcs = filter col selector(dt)
);
It gives you a lot of options for reduction.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content