cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP Security Notice: CVE-2026-109618 and CVE-2026-109619

    JMP promptly initiated a review of its products, services, and relevant infrastructure for exposure to CVE-2026-109618 and CVE-2026-109619.

    Our assessment of JMP products has not identified exposure to these vulnerabilities. Where remediation was required within supporting environments, appropriate security updates and controls have been applied and validated.

    We have identified no evidence of successful exploitation or unauthorized access to JMP systems or customer information associated with these vulnerabilities.

    JMP continues to monitor the issue and relevant vendor guidance. No action is required by JMP customers at this time.

  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
sanqub
Level III

How do I make combo box to show unique values?

Dear All,

This script is similar to one in book "JUMP into JMP".

The script prompts user to select a "DCM", based on this selection "DieNo" list is populated.

There are couple of problems here. "DCM Number" list is not in ascending order.

Other issue, When I select a DCM number, "DieNo" list is populated. But this lists all the values, I want only unique values to be listed.

For both columns data type is char, however numeric datatype doesn't work here. Any advice on this problem.

 

/* Open the sample data table */
dt = Open( "$Desktop/JMP scripts/SampleData.jmp" );

/* Create lists of the values found in the DCMNo and Die columns*/
Unique DCM=Associative array(dt:DCMNo);
nitems(unique DCM);
DCM1= unique DCM<<get keys;
DCM=Sort Ascending(DCM1);
Unique Die=Associative array(dt:DieNo);
nitems(unique Die);
Die= unique Die<<get keys;
dt << Clear Column Selection();
dt << Clear row Selection();

/* Use New Window to create a non-modal dialog to display DCMNo and Die for user to choose. */
nw = New Window( "Choose DCM Die combination",
	hb = H List Box(
		Panel Box( "Select a DCM Number",
			select1 = Combo Box(
				DCM,  
/* Each of the following tasks are executed when the user makes a DCMNo choice.*/
				dt << Select Where( :DCMNo == DCM[select1 << get] );
				selRows = dt << Get Selected Rows;
				pb << delete;
				myDies = {};
/* The myDies list is populated with values from the selected DCMNo. */
				For( i = 1, i <= N Row( selRows ), i++,
					Insert Into( myDies, Column( dt, "DieNo" )[selRows[i]] )
				);
/* A new panel box is drawn and values shown are based on DCMNo selection. */
				hb << Append( pb = Panel Box( "Select a Die", select2 = Combo Box( myDies ) ) );
			)
		),
		pb = Panel Box( "Select a Die", Combo Box( " " ) )
	),  
/* If user clicks OK, values displayed for DCMNo and Die will be selected in table. */
	Button Box( "OK",
		nw << Close Window;
		dt << Select where( :DCMNo == DCM[select1 << get] & :DieNo == myDies[select2 << get] );
/* Selected rows are subsetted into new table. */
		rows=dt << get selected rows;
		dt << subset( Output Table Name( "Ryobi Details" ) );
	)
);

 

I am also trying to include date selection combo box. The best post and easy option for this was "date data filter".

Does JMP allow me to show a calender for dates {A wee calender as shown when we book flights from depature date to arrival date}.

 

Cheers

 

San

10 REPLIES 10
pmroz
Super User

Re: How do I make combo box to show unique values?

The scripting index and guide are somewhat weak with regard to this new function.  The examples in the scripting guide could be beefed up a bit.  Here's a better one that displays the calendar.  When you select a date and click OK that is printed in the log window.

Names Default To Here( 1 );
nw = New Window( "Calendar Box Example", 
	cal = Calendar Box(),
	ok_button = button box("OK",
		selected_date = format(cal << get date, "ddMonyyyy");
		print(selected_date);
		nw << close window;
	)
);

Recommended Articles