cancel
Showing results for 
Search instead for 
Did you mean: 

mapping issue

Former Member
0 Kudos

Hi All,

I have a source structure like this

Source:                                                        Target:

<Root>                                                             records 0:99999

    segmentA 0:1                                                fieldA1

         fieldA1                                                      fieldB1

    segmentB 0:99999                                        fieldB2

        fieldB1 0:1                                                 fieldC1

        fieldB2  0:1                                                fieldC2

        segmentB1 0:10

          fieldB11 (value = A,B,C,D,E)

          fieldB12

the number of records in the flat file is based on the number of segmentB. The feildC1 = fieldB12 when fieldB11 = 'A'. fieldC2 = fieldB12 when field B11 = 'B'.  when there is no fieldB11 has value A, fieldC1 = blank; when fieldB11 = 'A', but there is no fieldB12, fieldC1 = blank. The same logic applies to fieldC2.

Can anyone has an idea on how the mapping logic for fieldC1 and FieldC2 would be?

Thanks a lot!

Meiying

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

For field C1, apply the mapping logic :  "(IF B11 equalS constant[A] OR B11 equalS constant[]) then map field B12 to field C1 via UDF "map with default[]".

For field C2, appply the mapping logic : "(IF B11 equalS constant[B] OR B11 equalS constant[]) then map field B12 to field C2 via UDF "map with default[]".

Regards,

Souvik

Former Member
0 Kudos

Hi Souvik,

Thanks for the reply. Unfortunately, the logic doesn't work. The main problem is segmentB1 is multiple and field B11 may not have value A at all in the source. When this happens, after if-then, in "Display Queue", only show "suppress". no value pass over. since field C1 is mandatory, system gave "Missing value" error and it won't map to "mapwithdefault[]". I will give you an example:

Thank you!

Meiying

Former Member
0 Kudos

Just to point out here that UDF "map with default[]" does not allow the target field to be suppressed.

Former Member
0 Kudos

The problem is resolved. I changed the context of fieldB11 to segementB. It worked.