cancel
Showing results for 
Search instead for 
Did you mean: 

2 conditions in mapping

Former Member
0 Kudos

Hi Friends,

I have difficulty in createing the below mapping.I have 2 conditions ie

Parent segment

Field1 otype-->value should be 'p'

Field1 filter1--->value should be 'DE04'

Note:Both the above fields are present in parent segment.

If it satisfies,then a constant number (123) should be passed to the target field. The target field should be generated with no.123 as many times the condition satisfies.

If condition doesnt satisfy then a value from child segment need to be passed to target field

Child segment(present below the parent segment)-->Child segment generates multiple times.

Child segment

Telno-->'some number'

Please help me with complete flow of this mapping including node functions ,as i am not good in graphical mapping.

Regards,

Suresh.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Suresh,

Both Suraj & Fatima are giving same solution.

So my suggestion is better to use with " Remove Context" if any case of multiple rows are found.

Regards,

Sateesh N.

Former Member
0 Kudos

Hi Experts,

Pls check the existing mapping in the link.

http://www.flickr.com/photos/28121590@N08/3994828417/sizes/o/

1.I dont understand why the concat function is used and is mapped with segment E1P0006.

2.As you can see the lower E1P0006 segment is in italic as its context is set to Parent node and the upper E1P0006 context is set the child by detault.Is this correctly done?

3.When i try to check the queue of 'IF'function it is throwing error 'cannot cast null to boolean, however when i test from test tab it output field is generating.

Please help me with the right approach to complete this task.

Regards,

Suresh.

former_member187339
Active Contributor
0 Kudos

Hi

>>1.I dont understand why the concat function is used and is mapped with segment E1P0006.

Even I didn't understand... Who made this mapping?? BTW check the third reply

>>2.As you can see the lower E1P0006 segment is in italic as its context is set to Parent node and the upper E1P0006 context is set the child by detault.Is this correctly done?

Not correct technically.. functionally you need to check with the functional guy

>>3.When i try to check the queue of 'IF'function it is throwing error 'cannot cast null to boolean, however when i test from test tab it output field is generating.

Take the output of and and put to the if node and it will work

Regards

Suraj

Answers (2)

Answers (2)

Former Member
0 Kudos

Do the mapping as


otype---->removeContext----> equalS-------------\
                      Constant[p]/                                   constant[123]--->  then
                                                   ---and----------------------------->if--------------------->Target Field
filter--->removeContext---->equalS----------------/           telnet----removeContext---->else
             Constant[DE04]/                          


former_member187339
Active Contributor
0 Kudos

Hi Suresh,

If i understood correctly,

if field otype = 'p' and field filter1 = 'DE04 then output = 123 else child telno

bu my doubt

1. Will the occurrence of parent field otype and filter1 will always be same?

2. What abouty child-telno? See if nth parent = p and filter is not DE04 then value of nth child should be taken? IS this the case?

3. Can we use UDF for this or you need node functions alone?

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

Thanks for responding !!

Here are my answers-->

1. Will the occurrence of parent field otype and filter1 will always be same?

Ans 1: Generally for 1 parent segement(1..unb) the fields OTYPE and FILTER1 appear only once.

2. What abouty child-telno? See if nth parent = p and filter is not DE04 then value of nth child should be taken? IS this the case?

Ans 2: Yes

3. Can we use UDF for this or you need node functions alone?

Ans 3: I want to use node functions most probably.

Regards,

Suresh.

former_member187339
Active Contributor
0 Kudos

Hi Suresh,

Try this


                                             Constant (123)
(otype = constant('p)) --_| AND - if then -------------------------| target
(filter1 = Constant(DE04)-|          else
                                              mapwithdefault-telno

Regards

Suraj