cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
572
Views
0
Helpful
1
Replies

formula in crs (ivr)

kolotov83
Level 1
Level 1

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

1 Accepted Solution

Accepted Solutions

Aaron Harrison
VIP Alumni
VIP Alumni

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 true

if (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....

Aaron Please remember to rate helpful posts to identify useful responses, and mark 'Answered' if appropriate!

View solution in original post

1 Reply 1

Aaron Harrison
VIP Alumni
VIP Alumni

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 true

if (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....

Aaron Please remember to rate helpful posts to identify useful responses, and mark 'Answered' if appropriate!