cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
Jackie_
Level VI

Optimize Assign values to selected rows

Hi JMP Community,

 

I wrote a jmp script to assign a string to the selected rows in the graph builder.

The script will generate a wafer map for the X and Y coordinates. Users can select a region of a wafer and assign a string to the selected rows.

The script works fine, but it takes a very long time to assign values to more than 10k selected rows. Am using :Column[rows] = "string" logic.

Is there a way to optimize or assign it faster? Any feedback?

 

Code:

dt = current data table();
New Window( "",
	modal,
	V List Box(
	hlistbox(
		Panel Box( "Assign",
			H List Box(
				Text Box( "Enter :" ), 
								
				Spacer Box( size( 10, 0 ) ),
				tp = Text Edit Box( "", <<setwidth( 60 ) )
			), 
								
			Spacer Box( size( 10, 10 ) ),
			H List Box(
				Button Box( "Assign bin", 
													
					ndies = N Items( dt << getselectedrows );
					
															
														
					Caption( "Processing... please wait", Font( "Arial Black" ), spoken( 0 ) );
					Wait( 0 );
														
					dt << label();
					getbin = tp << get text();
					rowind = dt << get selected rows;
					:Bins[dt << get selected rows] = getbin;
					Caption( "Assigned", Font( "Arial Black" ), spoken( 0 ) );
					Wait( 0.2 );
					Caption( remove );
					Wait( 0 );
				)
			)
		), 
		teb = Textbox()),
											
		dt << Graph Builder(
			Size( 534, 456 ),
			Show Control Panel( 0 ),
			Variables( X( :X coord ), Y( :Y coord ), Color( :Bins ) ),
			Elements( Points( X, Y, Legend( 5 ) ) ),
			Local Data Filter( Add Filter( columns( :Bins ), Where( :Bins == "1" ), Display( :Bins, N Items( 7 ) ) ) )
		)
	)
)

 

1 ACCEPTED SOLUTION

Accepted Solutions
Craige_Hales
Super User

Re: Optimize Assign values to selected rows

Maybe this, but I did not see it being very slow, so maybe this isn't the problem:

						dt<<begindataupdate;
						:Bins[dt << get selected rows] = getbin;
						dt<<enddataupdate;
Craige

View solution in original post

2 REPLIES 2
Craige_Hales
Super User

Re: Optimize Assign values to selected rows

Maybe this, but I did not see it being very slow, so maybe this isn't the problem:

						dt<<begindataupdate;
						:Bins[dt << get selected rows] = getbin;
						dt<<enddataupdate;
Craige
Jackie_
Level VI

Re: Optimize Assign values to selected rows

@Craige_Hales it works