cancel
Showing results for 
Search instead for 
Did you mean: 

restricting the individual records going to target interface

Former Member
0 Kudos

hi

i have a source structure like this

records < 1>

data < 0 to unbound>

field1<1>

field2<1>

field3 <1>

my target structure is also same., now lets say i get 5 records in fo type data with 2 records with field1 value as 'A" and 1 record with field1 as B and 2 records with field1 as C. in the target structure i want only records with field1 = A.

how can i achieve this ?

thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Just use the below one.

field1(Right click and Change Context to records Node) -


> equalS (Constant A) ->CreateIfdata

Regards,

Prakasu.M

Answers (4)

Answers (4)

former_member200962
Active Contributor
0 Kudos
thanks for your reply. can u explain it in more detail?

First of all i am comparing value in field1node with a constant....Constant is given value A as you are expecting the field1 value also to be A.

equalS...this is a standard function available in essage mapping under Text functions.....it will compare the two input strings and check if both are having the same value....it's putput will be a Boolean value...true(1) or false(0)...

This is given to the If parameter of the ifWithoutElse function( present under Boolean functions)....now when the input to if parameter is true(1) the further processing will happen....

I have mapped data node to the then parameter....why??....in you source and target structure data node willbe repeating and also as per your req you want to have repeatitioons for the data element....doint this you will be saving the effort of first executing the data node and then checking for the condition.....as per the logic given in the other mapping field1 is mapped which will execute the data node and then check for field1 = A....which is not desirebale.......

then i have mapped theoutput of ifWithoutElse to target data node.....

Increasing the context of field1 nde to that of record will help you acheive the logic for all occurences of data node.....

Former Member
0 Kudos


field1
             ------> equalS ---> ifWithoutElse ---------------> Target(data)
Constant(A)                                            field1  /


 to change the context of field1 right click on the field1 then select record.

In the above target field mapping u r first checking the value of field1 with Contants "A" (Constant is the standard function u can select this in message mapping in  data flow editor displayed at botton right side)


equalS return TRUE or FALSE and if the field1 value equals constant "A" (if u double click on constant fucn u can give *A* value under dialog box)then returns TRUE



Then u r using ifWithoutElse function .It Check if the value is true then u r sending the value of field1 to target data field.In this way target field "data" will be generated as many time as the function ifWithoutElse return True.


u can debug the message mapping by selecting  Display Queue (right click on the each field  and then select Display Queue)

Former Member
0 Kudos

hi

thanks for your reply. can u explain it in more detail?

thanks

former_member200962
Active Contributor
0 Kudos
i have a source structure like this
records < 1>
data < 0 to unbound>
field1<1>
field2<1>
field3 <1>
my target structure is also same., now lets say i get 5 records in fo type data with 2 records with 
field1 value as 'A" and 1 record with field1 as B and 2 records with field1 as C. in the target structure 
i want only records with field1 = A.

Try below logic:

field1
             ------> equalS ---> ifWithoutElse ---------------> Target(data)
Constant(A)                        Then-data

you may need to increase the Context of the source filed1 to upper level in the above logic.

Regards,

Abhishek.