Skip to Content
avatar image
Former Member

value exists

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 24, 2008 at 10:27 PM

    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]);
    }
    

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 25, 2008 at 03:09 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 25, 2008 at 12:09 AM

    Hi folks

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

    Thnx

    Add comment
    10|10000 characters needed characters exceeded