cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

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

Insert user input into a basic calculation in jsl

Hi all,

I want to ask user to insert number of months for analysis. This value will be used in equation to select the last "insert months" of rows and then subset.

I prepared following part at the beginning, but this leads to an error.

 

Names Default To Here( 1 );
nw = New Window("", <<Modal, <<Return Result,
	HListBox(
		Panel Box("How many months would you like to analyze?",
			Lineup Box(
				2,
				nom  = Number Edit Box( 0 , <<Set Increment(1), <<Set Show Spin Box(1)),
			)
		)
));
time = nom << get;

dt1 = Open( "file link" );

// Select last 180 days in Seconds and Subset
dt1 << Select Where(Contains(:Run Type, "Prod") & :Date Time >= (:Date Time[N Rows (Current Data Table())]-(60*60*24*30*time)));
dt1 << Subset( Output Table( "Subset of file" ), Selected Rows(1), Selected columns only( 0 ) );

and the error is:

error jmp.png

Already thanks for you help..

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Insert user input into a basic calculation in jsl

Because the window is closed after pressing OK you will loose the reference to Number Edit Box. Because you are using << Return Result you can use this

time = nw["nom"];
-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: Insert user input into a basic calculation in jsl

Because the window is closed after pressing OK you will loose the reference to Number Edit Box. Because you are using << Return Result you can use this

time = nw["nom"];
-Jarmo
Metin_Tueluemen
Level III

Re: Insert user input into a basic calculation in jsl

Thank you very much. Worked perfectly :D

Recommended Articles