09-22-2010 12:15 AM - edited 03-16-2019 12:55 AM
How to write next formula is easier:
if (p_value == -1 && type == "01" && status == "01" || p_value == -1 && type == "01" && status == "04" || p_value == -1 && type == "01" && status == "05" || p_value == -1 && type == "01" && status == "06" || p_value == -1 && type == "02" && status == "01" ..... )
Data:
type = 01, type = 02, type = 05, type = 06
status = 01, status = 04, status = 05, status = 06
Solved! Go to Solution.
09-22-2010 01:48 AM
Hi
Not sure if this is 'easier', but it may be shorter. This will *probably* require a premium license, but I can't realy test that here.
Try this:
1) Add a boolean variable called 'testresult' or whatever
2) Add a 'set' step, and set testresult to this:
{
String[] acceptStatus = new String[] {"01","04","05","06"}; // Set up list of types that should return true
String[] acceptTest = new String[] {"01","02","05","06"}; // Set up list of status that should return trueif (java.util.Arrays.asList(acceptStatus).contains(status)
&& java.util.Arrays.asList(acceptTest).contains(type)
&& p_value == -1){
return true;
} else{
return false;
}
}
3) You can then use 'testresult' as a test for the If step an do what you will under that.
Aaron
Please rate helpful posts....
09-22-2010 01:48 AM
Hi
Not sure if this is 'easier', but it may be shorter. This will *probably* require a premium license, but I can't realy test that here.
Try this:
1) Add a boolean variable called 'testresult' or whatever
2) Add a 'set' step, and set testresult to this:
{
String[] acceptStatus = new String[] {"01","04","05","06"}; // Set up list of types that should return true
String[] acceptTest = new String[] {"01","02","05","06"}; // Set up list of status that should return trueif (java.util.Arrays.asList(acceptStatus).contains(status)
&& java.util.Arrays.asList(acceptTest).contains(type)
&& p_value == -1){
return true;
} else{
return false;
}
}
3) You can then use 'testresult' as a test for the If step an do what you will under that.
Aaron
Please rate helpful posts....
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide