- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Setting up a pre-selection of categories and variables for Dashboard users
I need my dashboard to be fully flexible and allow users to pre-select:
a- The reference category from the variable "Group"
b - The variables on which to run the dashboard on.
Then, the dashboard to use these such the code knows that:
Ref = "name of reference group selected"
cols = { list of columns selected}
Is there a way to have a dialogue window populate with the categories of a variable and the names of the columns, that users then pick from, click OK and then the dashboard runs as normal?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Setting up a pre-selection of categories and variables for Dashboard users
Have a look at the column dialog or filter col selector functions to let the user pick a column (the following examples are from the Scripting Index):
Names Default To Here( 1 );
Open( "$SAMPLE_DATA/Consumer Preferences.jmp" );
Column Dialog(
ex y = ColList( "Y", Min Col( 1 ), Max Col( 2 ), Data Type( "Numeric" ) ),
ex x = ColList( "X", Max Col( 1 ), Modeling Type( {"Continuous", "Multiple Response"} ) ),
Line Up( 2, Text Box( "Alpha" ), ex = EditNumber( .05 ), Text Box( "Beta" ), ey = EditText( "xyz" ) ),
HList( cb = Check Box( "check", 1 ) ),
HList( combo = Combo Box( "option1", "option2" ) ),
HList( rb = RadioButtons( "a", "b" ) )
);
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Window( "Col List Box Example", fontobj = lb = Filter Col Selector( width( 250 ) ) );
A radio box might help select levels of a column:
Names Default To Here( 1 );
dt = Open("$Sample_data/Big Class.jmp");
New Window( "Example", rb = Radio Box( associative array( dt:sex << get values ) << get keys ) );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Setting up a pre-selection of categories and variables for Dashboard users
That is great, i've managed to set it up for my data, but two things I'm not too sure about now.
- is rb the selected item? can I then use it in the code:
oneway1 = dt << Oneway( Y( cols[1] ), X( :Group ), With Control( 1, {"rb"} ) )
- Can I set a button to say ACCEPT and then it closes the window?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Setting up a pre-selection of categories and variables for Dashboard users
You could use rb << Get or rb << Get Selected. Here is how I found that in the scripting index (available under the help menu):
As to closing the window, a web search for 'jmp new window get user input' took me to the link below which has an example to get you started:
Re: How do I display a text box asking for input from the user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Setting up a pre-selection of categories and variables for Dashboard users
Thank you for the pointers. It is all looking very promising, I have two final questions on this, I did a search on the community and in the scripting guide, but I couldn't see answers so apologise for the basicness.
- Is there a way for users to select multiple options from the radio box?
- My list of columns is very long, and it would be helpful to have the list over 3 columns - is it possible to format the radiobox to display the options over multiple columns?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Setting up a pre-selection of categories and variables for Dashboard users
You could use a check box instead which does allow multiple selections. As to showing that in multiple columns I don't know of an out-of-box method but you could subset the larger list and display a third of the list in separate check boxes, and then have your script look through the results of each.
Another option, if you want the user to select a column from a list of columns, check out the Column Dialog object. That might give you a quick way to create your whole launch window.