Skip to Content
avatar image
Former Member

Concat values from two diffreent nodes.

Hi,

I'm getting SUPRESS; When i want to concat values from diffrent nodes.

example:

Node1: <11> <> <12> <> <> <13> <> <> <> <>

Node2: <21>  <22> <23> <24> <25> <26> <27> <28> <29> <24>

should be Result: <1121> <1122><1223><1224><1225><1326><1327><1328><1329><1324>

<>   is no value or no node occures.

help is appriciated.

thanks.

Prema Boodi

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Mar 29, 2012 at 08:51 PM

    Hi Prema

    You can write a UDF to do this.

    Take two inputs A and B for Node1 and Node2

    String s1=A[0]

    for (int i=0;i<A.length();i++)

    { if (A[i]=="")

    { res=s1.concat(B[i];

    else

    { res=A[i].concat(B[i]);

    s1=A[i];

    }

    }

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      cross check the code

      String s1="";
      for (int i=0;i<A.length;i++)
      {
      if (!(A[i].equals("")))
      s1 = A[i];
      res.addValue(s1.concat(B[i]));
      }

      i hope it will not work it will not work for the muiltiple values. Do thorough testing(Ex: Field1: 1, field1:no value, field1: 2 and field2:3, field2:4, field2: 5... your output should be 13,14,25).. cross check...