cancel
Showing results for 
Search instead for 
Did you mean: 

Ho to take a value based on a condition

Former Member
0 Kudos

Hi Experts

Ho can we use if and if than else functions.

I have one condition like if WAAGNR is 0001 than take the value as 1 in the target system otherwise blank in the target system .

Please guide me how can i achieve this.

Thanks

Edited by: aquarian sharma on Feb 11, 2008 9:39 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

U can do it in graphical mapping itself.

input element(which will have comparision value 001) second input constant 001 give both input to equals standard function. output of equals is either true or false. give this output to ifwithelse function. in then use constant with 1 value and in else use the constant with null value.

and map the output of ifwithelse to the target element.

So when the input value is 001 then the target element value populated with 1 value otherwise it will be null.

Thnx

Chirag

Edited by: Chirag Gohil on Feb 11, 2008 2:15 PM

Former Member
0 Kudos

Hi Chirag

I am trying to map it graphically it might be very stupid but this is how i am doing it.

I have a input field let us say WAAGNR which i map to equals but when i am taking another field constant with value 0001 i am unable to map equals with constant .

can you please be a bit more descriptive i know its very stupid but still.

Thanks

Former Member
0 Kudos

Hi,

U need to use the constant function and double click on constant function it will give u one text line put there 0001 ans say ok. and give the output of constant to equals.

Thnx

Chirag

Former Member
0 Kudos

Thanks a lot friends.

One more problem i am creating a new thread please help me in that also.

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Aquarian,

Chirag has given the perfect answer.

But i think an if-else would suit your functionality better, if you need the field to be created with a blank value.

You map as follows

If WAAGNR Equals 0001(Constant) Then map Constant value 1 to the target

else map Constant (blank space) to the target.

Regards,

Lavita.

Former Member
0 Kudos

Hi Lavita

Which Equals should i use as my output is not coming right.

I am doing this way

WAAGNER and a constant(0001) going to equalsA (now i am using this Arithmetic equal before this have tried with the other 2)

this equals is pointing to a if then else (if from the boolean) and in it the value of then is constant(1) and else value is constant(blank) and this if then else is mapped to my target field Scale item .

Can you please help me in solving this problem as i am totally new to this XI.

Thanks

Former Member
0 Kudos

Hi Aquarian,

Use the EqualsS from the TEXT funxtion. I've tried it out and its working fine.

Let me know if you need more help on this.

Regards,

Lavita.

P.S. Do reward points if the information is useful.

Thanks.

Former Member
0 Kudos

Hi,

Can you try to use equals boolean function and try.

Thnx

Chirag

Former Member
0 Kudos

Hi,

You could easily achive this either with if else statement or using the API FixValues in Conversion function of Graphical mappings.

Field WAAGNR -->equals to (0001) Constant --->If true then pass 1 -


>else pass blank value in constant.

If you have multiple values for field WAAGNR then probably you could use API FixValues in Conversion function of Graphical mappings.

Field WAAGNR ---> FixValues ---> Target Field.

here double click on fixvalues and give the 0001 as on left side and the value to be passed as 1 on right side.

Similarly if you need many values to be mapped then instead of useing multiple IF..else statements you could use FixValues function.

Thanks

Swarup

Former Member
0 Kudos

Friend i am again stuck with this problem actually i did it with Fix value API

But its not happening

I detail you the scenario

Let us say there is a sender field named WAAGNR which can have 2 values 0001 or other than 0001 and this has to be mapped with Scaleitem

If sender has the value as 0001 than the value to scaleitem should be 1 and if its otherthan 0001 than value to the target systenm should be blank.

I am trying to do it with the Fix Value but its not happening.

And the way you have given i am unable to map that way i am totally new to XI please help in a more detailed way.

Thanks

former_member614185
Contributor
0 Kudos

Hi sharma,

If your condition is yes, you are assigning some value to some filed.

My question is from where you ae taking the value.

Is it constant or do you taking from the source message.

Former Member
0 Kudos

Hello ,

Go thru this Blog...

/people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination

With Regards,

BVS.

**********please reward points if found useful