cancel
Showing results for 
Search instead for 
Did you mean: 

value exists

Former Member
0 Kudos

hi all

I need a favor.

I need a java udf : I will take values in a context function and if second value in array does not exist ,I return a blank ,else I return the second element within the array.

Thnx

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Try the UDF I have given below. I gues sthis is your requirement.


if(a.length < 2)
{
 result.addValue("");
}
else if(a.length ==2)
{
result.addValue(a[1]);
}

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

You don't required UDF. You can use SplitByValue(Each value) and Collapse Context to solve this problem.

InputValue --> SplitByValue(Each value) --> CollapseContext.

Regards,

Rohit.

Former Member
0 Kudos

Thnx ,awarding points to Amit and some points to Rohit too.The udf worked.

Regards

Former Member
0 Kudos

Hi folks

1) So in this case ,i dont need to iterate? no for loop needed?

Thnx