cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping help required - extension

Former Member
0 Kudos

Hi,

I 've done the mapping based on the below conditions

Let say 3 fields called : a,b,c

if a = RAM then

b = b/c

here b field is in one segment and a & c fields are in child segment of above segment.

Note : all the above fields occurance : 0 to 1

But, i need to display the target including with the above condition also i need the value of the field "b" should display at target side where the condition doesn't satisfy .. ie., a # RAM.

Here i 've tried with if then else condition...but that doesn't work.

Please help me out how can i get the output.

Thanks in advance for your help

Regards,

Y.Raj

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Assuming that the node in which a and c occur is 0:1.

Then the following mapping should work for you even without any context changing.

http://4.bp.blogspot.com/_5ov9AjKNCiY/S6uLJv4kY3I/AAAAAAAABwU/g62W0JZ7WIs/s1600/Mapping.png

Former Member
0 Kudos

I 've done the same way...but when i display the queue the output showing in BOLD letters.

But, when i execute it from test tab all the values populating at target side.

justin_santhanam
Active Contributor
0 Kudos

What is a # RAM means? Do you meant to say


 a *not equal to* RAM?

Thanks!

Former Member
0 Kudos

yes...Raj

justin_santhanam
Active Contributor
0 Kudos

Are you looking for something like this -http://www.flickr.com/photos/8764045@N06/4461932970/sizes/o/ ?

Thanks!

former_member187339
Active Contributor
0 Kudos

Hi Yeshwant,

IF you have the source structure as:

segment

--b

---subsegment

-


a

-


c

then you may need these changes in Raj's mapping image


b-----------------------------------|
c (context changed to parent of c)--| useoneasmany -- divide
c ----------------------------------|

b-----------------------------------|
c (context changed to parent of c)--| useoneasmany -- else 
c ----------------------------------|

Regards

Suraj

Former Member
0 Kudos

I 've used this...somehow it's working when i open the display queue

but, if i check the target result...the values are not coming properly

Former Member
0 Kudos

Thanks...Suraj

But, can you please give me the proper mapping sothat i can try it out.

former_member200962
Active Contributor
0 Kudos

In the mapping by Paj you have to raise the Context of source fields to a common (higher) node.

The mapping logic needs to have a mapWithDefault before the equalS operation.....if not placed it will fail to give output....check this discussion...it may help:

Regards,

Abhishek.

former_member204873
Contributor
0 Kudos

create an udf with three input parameters a,b,c and then use:

String out = "";

if(a.equals("RAM")){

out = b/c;

}

else{

out = b;

}

return b;

As cardinality is 0 .. 1 for all fields use mapwithDefault standard function for all the fields before the calling the UDF.

former_member200962
Active Contributor
0 Kudos

For a = RAM

a -->
                   --> equalS --> if (Then --> Source) --> Target
Constant(RAM) -->

For a not equal to RAM

a -->
             --> equalS --> Not --> if (Then --> b) --Target
Constant(RAM)

Try setting the context to a higher node since you mentioned that the fields are in different segments.

Regards,

Abhishek.