cancel
Showing results for 
Search instead for 
Did you mean: 

simple mapping Question

Former Member
0 Kudos
72

Hello,

I am trying to use graphical mapping for below scenario.

I have two fields X and Y in souce and Z in the source. If X has the value it should map to Z and If X is empty then Y should map to Z.

is any graphical function to check this.

Thanks,

Srinivasa

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

u can use the followin UDF.

the input to this function will be ur three source fields(a,b,c)

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

{

if(!a<i>.equals(""))

{

result.addValue(c);

}

else if(a<i>.equals(""));

{

result.addValue(b);

}

}

if u still face the problem please reply me back.

Thanks

Rinku

Answers (9)

Answers (9)

Former Member
0 Kudos

Hello rinku,

Thank you very much.

Thanks,

Srini

Former Member
0 Kudos

Can anybody give java function for this.

Thanks in advance,

Srinivasa

justin_santhanam
Active Contributor
0 Kudos

Srini,

Sorry for the late reply. According to ur Display queue , it seems u've more than one value for X? Could u plz confirm it?

raj.

Former Member
0 Kudos

What exactly the exists will check. I am getting allways true if i give value or not to X.

This means that exists will check whether node exists or not. And it will not checkthe value. is there any other function to check.

Srinivasa

Former Member
0 Kudos

Hi,

My X filed is 1...1

even if i give desription or not, the exists is showing the same thing. i think exists function is right or not.

i want to see Y only if X value is empty. If i have X i should see X

Not sure what is wrong.

thanks,

Srinivas

Former Member
0 Kudos

Hello,

I am getting like below. Xvalue is what ever i am giving in X field.

Exists in Exists out

SUPRESS false

X value true

Xvalue false

Thanks,

Srinivas

Former Member
0 Kudos

Hello,

I am trying with Exists function. But, the result is not coming as expected.

the four corners of if corners are pointed like below

X -- Exists --> if

X --> then

Y --> else

4th corner pointing to Z

What is wrong.. if X has no value it should take calue of Y.. But it is happening.

Please suggest.

Srinivasa K

justin_santhanam
Active Contributor
0 Kudos

Srini,

Right click on Exists function and say Display Queue. Could you let us know what value are u getting?

raj.

justin_santhanam
Active Contributor
0 Kudos

Srini,

Follow this logic.



X---->mapwithDefault[No Value] & Constant[No Value]----->eQuals---->IF THEN ELSE--->Z

THEN----->Y
ELSE----->X

Additional Info

Don't use Exists function , if you are node sure whether the parent node of X,Y will occur in source. You know what I mean,

Root 0..1

X 0..1

Y 1..1

In the above example, if the Root node doesn't occur then it will throw an error.

So I would suggest you to use, MapWithDefault if the root node is 0..1, if not go with exists as friedns suggested above.

Hope it helps!

raj.

Edited by: Raj on Mar 13, 2008 12:05 PM

Former Member
0 Kudos

Srinivas,

Use exists function to check whether exists or not. If X exists and the length is greater than zero then you map X else you map Y.

Regards,

---Satish

Former Member
0 Kudos

Hi,

Try using the exist functionality. First vheck fi the X is exisiting then pass the value to Z or else pass the value of Y

x- exists - ifelse - output

Regards

Vijaya