cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping logic

former_member223432
Participant
0 Kudos

HI experts,

I having a following requirement.

File to File:

based on the filtering conditions, i need to filter the file.

i have 50 records in my file, If my Field1 = A, then i need to perform some filtering and then populate the records. which in this case will reduce the records at the target structrure. may be 35.

If Field1 is NOT EQUAL = A, then i need to populate all the 50 records as it is.

it is simple but somehow i am getting stuck in generating the records in both the cases with IF ELSE THEN as the source node is only ONE.

Can you please advise.

Regards

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You can use createIf node function at parent node of target.

former_member223432
Participant
0 Kudos

HI Vidhu,

I need to put 2 conditions on one single source node(SalesData)

if Field1 = A, then do the filtering(check for field2= B and field3 = C) and accordingly map the SalesData node to target node.

If Field1 # A, then Pass all the 50 records without any filtering and map SalesData to target node

CreateIF in this case doesnt work.

thx

sahithi_moparthi
Contributor
0 Kudos

Hi Smith,

Use below UDF:

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

{

if(var1[i].equals("A"))

{

if((var2[i].equals("B")) && (var3[i].equals("C")))

{

result.addValue(var4[i]);

}

else

{

result.addSuppress();

}

}

else

result.addValue(var1[i]);

}

former_member223432
Participant
0 Kudos

Thanks Sahiti..it worked..

Thanks for your kind help.

Regards

Answers (0)