cancel
Showing results for 
Search instead for 
Did you mean: 

***UDF for Splitby Value

Former Member
0 Kudos

Hi all,

My requirements is not to use Split by value.I require a UDF code for the same.

Thanks,

Srinivasa

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

Use UDF of type "all values from a context" with one parameter var1

Here is the code:

for (int k = 0; k< var1.length; k++){
  result.addValue(var1[k]);
  if (k < var1.length -1)
    result.addContextChange();
}

If you want to use it in a function of type "all values of the queue" it is more complex.

stefan_grube
Active Contributor
0 Kudos

Here is the code for a UDF of type "all values of the queue"

boolean isValue = false;

for (int k = 0; k< var1.length; k++){
   
  if (var1[k].equals(result.CC))
     isValue = false;
  else{
    if (isValue){
      result.addContextChange();
    }  
     isValue = true;
  }
   result.addValue(var1[k]);
}

Answers (3)

Answers (3)

justin_santhanam
Active Contributor
0 Kudos

split by value(each value) is the same as below code. Use the standard split by value, if you have any specific reqmt , do let us know.


result.addValue("");
result.addContextChange();

raj

SudhirT
Active Contributor
0 Kudos

You can use result.addContextChange in that case

Look at the thread below

Thanks!

Former Member
0 Kudos

Hi,

Why do you need a custom SplitBy function ? Does the standard one lack a feature ?

Chris