cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
Get the free JMP Student Edition for qualified students and instructors at degree granting institutions.
Choose Language Hide Translation Bar
View Original Published Thread

Number edit box not updating column

trevorphysics
Level II

I am trying to update a column with a formula given a text edit box input. I have attempted other solutions found on the discussions page but with no luck

 

In the beginning of my code I define the area as 1 as a default. This is also the default value inside of the number edit box:

 

area = 1;

 

I have a column that uses the area variable:

 

dt << New Column( "Current Density",
	Numeric,
	"Continuous",
	Format( "Best", 12 ),
	Formula( column(7) / area )
) << Move Selected Columns( {:Current Density}, after( column(7)) );

Then I have the function of the button. The hope is that it will take the updated value, plug it into the column and then rerun the formula in order to then update the plots I have in my JMP app.

 

NEB1 << Set Function(
					NEB1 = Number Edit Box();
					dt << set table variable( "area", NEB1 << get );
				);
				NEB1 << Set Number Changed(
					NEB1 = Number Edit Box();
					dt << set table variable( "area", NEB1 << get );
					dt << Rerun Formulas;

 

Currently it returns the variable as "."

 

Here are other possibly relevant settings for NEB1

				NEB1 << Set( 1 );
				NEB1 << Set Lock( 0 );
				NEB1 << Set Minimum( 0 );
				NEB1 << Set Exclude Minimum( 1 );
				NEB1 << Set Maximum( . );
				NEB1 << Set Exclude Maximum( 1 );
				NEB1 << Set Increment( . );
				NEB1 << Set Integer Only( 0 );
				

I'm not sure what I'm doing wrong. Any help to return a number and update the column would be greatly appreciated.

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User


Re: Number edit box not updating column

Here is how I would most likely approach this

Names Default To Here(1);
dt = New Table("Untitled",
	Add Rows(4),
	New Table Variable("area", 3),
	New Column("Column 1", Numeric, "Continuous", Format("Best", 12), Set Values([1, 2, 3, 4])),
	New Column("Column 2", Numeric, "Continuous", Format("Best", 12), Formula(:Column 1 * :area))
);

nw = New Window("window",
	Number Edit Box(:area, << set function(function({this},
		dt << Set Table Variable("area", this << get);
		dt << Rerun Formulas;
	)))
);

Note how table variable is referenced in the formula

-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User


Re: Number edit box not updating column

Here is how I would most likely approach this

Names Default To Here(1);
dt = New Table("Untitled",
	Add Rows(4),
	New Table Variable("area", 3),
	New Column("Column 1", Numeric, "Continuous", Format("Best", 12), Set Values([1, 2, 3, 4])),
	New Column("Column 2", Numeric, "Continuous", Format("Best", 12), Formula(:Column 1 * :area))
);

nw = New Window("window",
	Number Edit Box(:area, << set function(function({this},
		dt << Set Table Variable("area", this << get);
		dt << Rerun Formulas;
	)))
);

Note how table variable is referenced in the formula

-Jarmo
trevorphysics
Level II


Re: Number edit box not updating column

This seems to have worked. Thanks!