cancel
Showing results for 
Search instead for 
Did you mean: 

Removing redundant fields in mapping output

Former Member
0 Kudos

Hi Experts,

I have source and target structure same and its 1:1 mapping.

The output is:

1.I want to get rid of EXPR and EXCH occuring twice.

2.The <Conversion> tag should appear along with the EXPR and EXCH tag.

Below is sample output.

Regards

Alice Rebecca

Accepted Solutions (1)

Accepted Solutions (1)

former_member184681
Active Contributor
0 Kudos

Hi,

It looks like you simply need 's Nodeception:

This will help you group the outputs as you need it.

For the duplicate removal, you can use for instance the following UDF:

List list = new ArrayList();

String[] out = new String[0];

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

  if (!list.contains(var1[i]))

    list.add(var1[i]);

}

out = (String[]) list.toArray(new String[0]);

for (int i=0; i<out.length; i++) result.addValue(out[i]);

Regards,

Greg


Former Member
0 Kudos

Hi Greg,

 

Thanks for your suggestion and the piece of code. If you can refer the 3rd and 4th JPEG screenshot, we can see the difference.

In the 3rd figure, all the entries of fields EXPR EXCH AMOUNT NPRICES CONVERSION stacked in sorted manner by field. The required output i.e. Fig 4 shows in sequence.

  <EXPR>USD</EXPR>

  <EXPR>CAD</EXPR>

  <EXPR>USD</EXPR>

  <EXPR>CAD</EXPR>

  <EXCH>EUR</EXCH>

  <EXCH>EUR</EXCH>

  <EXCH>AED</EXCH>

  <EXCH>AED</EXCH>

  <AMOUNT>1</AMOUNT>

  <AMOUNT>1</AMOUNT>

  <AMOUNT>1</AMOUNT>

  <AMOUNT>1</AMOUNT>

  <NPRICES>1</NPRICES>

  <NPRICES>1</NPRICES>

  <NPRICES>1</NPRICES>

  <NPRICES>1</NPRICES>

The desired ouput should be in the form

<RESPONSE>

<EXPR>USD</EXPR>

<EXCH>AED</EXCH>

<AMOUNT>1</AMOUNT>

<NPRICES>1</NPRICES>

<CONVERSION>

<DATE>Fri, 01 Jun 2001 14:01:50 GMT</DATE>

</CONVERSION>

<EXPR>KWD</EXPR>

<EXCH>AED</EXCH>

<AMOUNT>1</AMOUNT>

<NPRICES>1</NPRICES>

<CONVERSION>

<DATE>Fri, 01 Jun 2001 17:12:09 GMT</DATE>

</CONVERSION>

<EXPR>USD</EXPR>

<EXCH>CAD</EXCH>

<AMOUNT>1</AMOUNT>

<NPRICES>1</NPRICES>

<CONVERSION>

<DATE>Sat, 02 Jun 2001 15:54:57 GMT</DATE>

</CONVERSION>

<EXPR>KWD</EXPR>

<EXCH>CAD</EXCH>

<AMOUNT>1</AMOUNT>

<NPRICES>1</NPRICES>

<CONVERSION>

<DATE>Sat, 02 Jun 2001 15:54:57 GMT</DATE>

</CONVERSION>

</RESPONSE>

Can we perform through Graphical mapping?

Regards

Alice

former_member184681
Active Contributor
0 Kudos

Dear Alice,

This "reorganization" of the output is realized by the Nodeception I mentioned previously .

Regards,

Greg

Answers (0)