cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
adam
Level IV

Conditional Pass/Fail based on limit

Hi guys,

 

Similar to one of previous posts, I have the following problem as shown as below:

 

In this case, if any of the result is >=15 in at least two sub_rad then it is consider Fail otherwise will be regarded as a Pass(as shown in the Pass_Fail col). Currently I'm using Formula but only know how to do it in a single sub_rad. Kindly suggest how can I do it with a script or formula.

 

Thank you.

 

IDtest_idtest_typemain_radsub_radresultPass_Fail
M101XS566312015Fail
M101XS566312116Fail
M101XS566312211Pass
M101XS566313012Pass
M101XS566313113Pass
M101XS566313214Pass
M101XW568332012Pass
M101XW568332116Pass
M101XW568332212Pass
M101XW568332012Pass
M101XW568333118Fail
M101XW568333220Fail
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Conditional Pass/Fail based on limit

This is a guess on what you want......not sure all of the conditions are properly being checked on

This is a formula.....not open JSL code

dt = Current Data Table();
holdID = :ID;
holdtest_id = :test_id;
holdmain_rad = :main_rad;
numGE15 = N Rows(
	dt << get rows where(
		holdID == :ID & holdtest_id == :test_id & holdmain_rad ==
		:main_rad & :result >= 15
	)
);
If( :result >= 15 & numGE15 >= 2,
	"Fail",
	"Pass"
);

jim's result.PNG

Jim

View solution in original post

3 REPLIES 3
cwillden
Super User (Alumni)

Re: Conditional Pass/Fail based on limit

It's not clear what group of runs is being sentenced as pass or fail.  I would think it would be all the sub_rads within the same main_rad & test ID, but that's not what the Pass_Fail column shows, otherwise row 3 would also be a fail.  Can you please clarify?

-- Cameron Willden
txnelson
Super User

Re: Conditional Pass/Fail based on limit

This is a guess on what you want......not sure all of the conditions are properly being checked on

This is a formula.....not open JSL code

dt = Current Data Table();
holdID = :ID;
holdtest_id = :test_id;
holdmain_rad = :main_rad;
numGE15 = N Rows(
	dt << get rows where(
		holdID == :ID & holdtest_id == :test_id & holdmain_rad ==
		:main_rad & :result >= 15
	)
);
If( :result >= 15 & numGE15 >= 2,
	"Fail",
	"Pass"
);

jim's result.PNG

Jim
adam
Level IV

Re: Conditional Pass/Fail based on limit

Sorry Cam, I didn't explain properly in the post. In this case, I am actually looking for at least 2 sub_rad that failed as my criteria hence that particular ID is consider failed. If the row 3 is out of spec then it is a failed as well otherwise I still regard it as a Pass. If I look at the overall (based on ID and result from sub_rad), then that particular ID is failed. 

 

Hope it did not sound confusing to you :) 

 

Thank you.