cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Help - Merging

Former Member
0 Kudos

Hi all,

I have a scenario where i need to merge all the values in a field for all instances and put it in one string target field. Can any body please suggest how to do that?

Source:

S-----

|-- Sequence

|-- Value

For all values of sequence (1,2,3,4 ...) Merger Value into one sigle string

Thanks and best regards,

Kulwant

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

The solution shuld work if you are not checking the sequence.

Please let me know if we need to check the sequence

Rgds

Aditya

Former Member
0 Kudos

Hi Aditya,

I am bit confused. Are you asking me or telling me?

amit

Former Member
0 Kudos

i did not respond to you

i jst replied saying tht the ure solution will work .. bt the author had commented somethng on sequece... you udf does not consider that part

Rgds

aditya

Former Member
0 Kudos

Hi All,

Thanks for replying. Yes i need to consider the sequence number.

I couldn't respond to your replies because of diff time zones.

Thanks,

Kulwant

Former Member
0 Kudos

Hi,

That's fine. Is your issue resolved now?

Thanks

Amit

Former Member
0 Kudos

hi,

No its not resolved yet

Former Member
0 Kudos

Hi,

Use Advanced User define Function. Create a UDF with Cache as Context and write the following code. It should work. Use this function between your source field sequence and target desired field.

If it doesn't work change the Context path of your source sequence field to point it to its one more level up node.


String newSeq = "";
 for(int i=0;i<a.length;i++)
{
newSeq = newSeq+a<i>;
}
result.addValue(newSeq);