Hi Guys,
I have the following table and would like to know how shall I set the formula(or JSL) where in this case, based on ID and MAIN_RAD, I would like to check on the value of SUB_1 to SUB_3. The condition is if at least 2 of the SUB has a value of more than 20 then it will be considered as FAIL otherwise PASS.
For instance as you will notice, for M101X at MAIN_RAD 1, the SUB_3 is more than 20 but consider PASS as it did not fulfill the condition of at least 2 SUB more than 20 in spec limit.
Thank you.
| ID | MAIN_RAD | SUB_1 | SUB_2 | SUB_3 | RESULT |
| M101X | 1 | 10 | 15 | 29 | PASS |
| M101X | 2 | 15 | 5 | 16 | PASS |
| M102W | 1 | 25 | 18 | 30 | FAIL |
| M102W | 2 | 8 | 14 | 11 | PASS |
| M110A | 1 | 32 | 12 | 15 | PASS |
| M110A | 2 | 51 | 45 | 30 | FAIL |
Here is a formula that will do what you want
If( Sum( SUB_1 > 20, SUB_2 > 20, SUB_3 > 20 ) >= 2,
"Fail",
"Pass"
)
The Sum() function is documented in the Scripting Index
Help==>Scripting Index==>Functions==>Sum
The handling of Boolean logic is covered in the Scripting Guide
Help==>Books==>Scripting Guide
If you are going to to be using JSl, you need to take the time to read the Scripting Guide!