cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Help

Former Member
0 Kudos

Hi all,

I have a scenario for mapping with

SOURCE:

|--Field Name

|--Field Value

|--Item Number

|--Sequence

TARGET:

|--ItemNumber

|--Text

I need to map all the Field values of source with Field Name as 'XBT' and concatenate them together in Sequence having Same Item Number and put that to Target Item Number and Text.

Can any body please suggest how to do that? Any help will be really appriciated.

Thanks

-Kulwant

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

For Parent target node you are required logic,

Use IfWithoutElse function. Check whether FieldName is 'XBT',using Equals function.

Make Keeps TRUE for for IfWithoutElse function.

Map one to one for ItemNumber

Map text by using concat function and all other source fields.

U don't required any further logic for child element.

Regards,

Rohit.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi, Thanks. I have got the answer

samiullah_qureshi
Active Contributor
0 Kudos

Hi Kulwant,

You can also do it by using a UDF in graphical mapping:-

String str = "";
for(int i = 0 ; i < FieldName.length ; i++)
{
if(FieldName<i>.equals("XBT"))
{
str = str + FieldValue<i>;
}
}
result.addValue(str);

This should work for your requirement for field value.

Item number can be mapped directly.

Regards,

Sami

former_member189441
Active Participant
0 Kudos

Hi,

Is this your requirment..??


Input FIle

Field Name    Field Value           Item Number             Sequence
  XBT               XYZ                 1                     1
  Field2            ABC                2                     2
  XBT                ABC               1                     3

OutputFile


ItemNumber              Text
1                       XYZABC

Former Member
0 Kudos

Hello Murli,

yes this is what my requirement is. I didn't replied to this earlier as i was on vacation.

Thanks

-Kulwant

Former Member
0 Kudos

HI Kulwant

Use JAVA or XSLT that suits best to you on this requirement.

Pseudo code can be

At occurance of Item number

match the value

if match

get node and concatenate

else

create another.

this will solve.

Thanks

Gaurav