cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
Choose Language Hide Translation Bar
shampton82
Level VII

Inputting a data range and "increment by" into a user input box

Hello everyone,

I am looking at putting in a wish list item but wanted to get some added input from the user community.  I was thinking it would be great to add to the Prediction and Tolerance interval Platforms the ability to put in a range and an increment by value into the input box so you wouldn't have to enter each scenario you are interested in one by one. 

 

For example, if I wanted to see what the tolerance interval looked like for 70, 80, and 90 Portion to cover I could input something like 70:90/10

shampton82_0-1728568179949.png

I believe there is syntax in JSL already to do this so might just copy what that looks like as the input.

 

So the question is: is there already a way to do this outside JSL that I am just missing.

 

I also don't think that this should be limited functionality to the Tolerance and Prediction analysis but that was the genesis of my wish list idea.

 

Thanks for any input!

Steve

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Inputting a data range and "increment by" into a user input box

I think you just have to decide the pattern you would allow and then parse it accordingly

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
obj = dt << Distribution(Column(:Height));

pattern_check = "\d+:\d+/\d+";
loop_pattern = "70:90/10";

If(IsMissing(Regex(loop_pattern, pattern_check)),
	Throw("Incorrect pattern (" || loop_pattern || ")");
);

minval = Num(Word(1, loop_pattern, ":"));
maxval = Num(Word(2, loop_pattern, ":/"));
inc = Num(Word(-1, loop_pattern, "/"));

increments = Index(minval, maxval, inc);

For Each({increment}, increments,
	obj << Tolerance Interval(Alpha(0.95), Proportion(increment/100));
	wait(0.5); // for demo purposes
);

show(minval, maxval, inc, increments);
-Jarmo

View solution in original post

4 REPLIES 4
jthi
Super User

Re: Inputting a data range and "increment by" into a user input box

Seems like this is simple to do in JSL (assuming this is what you want)

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
obj = dt << Distribution(Column(:Height));
obj << Tolerance Interval(Alpha(0.95), Proportion(0.7)); 
obj << Tolerance Interval(Alpha(0.95), Proportion(0.8));
obj << Tolerance Interval(Alpha(0.95), Proportion(0.9));

jthi_0-1728569007789.png

This is something that could be most likely easily "injected" to distribution platform (or create your own window for it which isn't annoyingly modal window) which would then allow you to easily add different proportions.

-Jarmo
shampton82
Level VII

Re: Inputting a data range and "increment by" into a user input box

Hey @jthi ,

Thanks for the input!  I was mainly trying to make sure there wasn't already something along below already available

shampton82_0-1728577878412.png

before I put in a wish list item and also if anyone had any other ideas I could incorporate into the wish.

 

For JSL, if I wanted to make this a loop based upon the user entering the min value, max value, and iteration value do you have any cool ideas how to loop through this?  I could hash out some ugly code to get there but I always learn something cool when I see what you come up with!

 

 

jthi
Super User

Re: Inputting a data range and "increment by" into a user input box

I think you just have to decide the pattern you would allow and then parse it accordingly

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
obj = dt << Distribution(Column(:Height));

pattern_check = "\d+:\d+/\d+";
loop_pattern = "70:90/10";

If(IsMissing(Regex(loop_pattern, pattern_check)),
	Throw("Incorrect pattern (" || loop_pattern || ")");
);

minval = Num(Word(1, loop_pattern, ":"));
maxval = Num(Word(2, loop_pattern, ":/"));
inc = Num(Word(-1, loop_pattern, "/"));

increments = Index(minval, maxval, inc);

For Each({increment}, increments,
	obj << Tolerance Interval(Alpha(0.95), Proportion(increment/100));
	wait(0.5); // for demo purposes
);

show(minval, maxval, inc, increments);
-Jarmo
shampton82
Level VII

Re: Inputting a data range and "increment by" into a user input box

And once again I learned a ton, thanks for the code @jthi !  Works greats.