Skip to Content
avatar image
Former Member

Counter

Hi Experts,

I have a requirement like B is my input field and C is my output filed the value of C should get increment by 10.So incase B comes for 3 times in my input,My output D should have the value 10,20,30 .It should get increment by value 10.I think this can be achived by using UDF by ADD function.

Regards,

Anitha

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Aug 04, 2009 at 05:27 AM

    Did you checked this?

    https://wiki.sdn.sap.com/wiki/display/XI/CountofRecords-%27Countontheeasiestway+through%27

    Rajesh

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 04, 2009 at 05:27 AM

    Hi,

    Write a udf (queue) with one input B and output as Result:

    int inputlength = B.length;

    int j=1;

    if (inputlength > 0){

    for (int i=0;i<inputlength;i++) {

    result.addValue(j*10);

    j++;

    }

    }

    Regards

    Suraj

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      result.addValue(j); might throw an error as j is an integer here.

      So before this statement just add and see String s = Integer.toString(j);

      and pass s instead of j into result.addValue

      And if there is an option to use standard function then avoid using this UDF.