on 08-03-2007 3:28 PM
Hi! All
It would be very helpful if i can get answer of how to implement the condition below, using the functions available in graphical mapping editor....
I need to map 2 source fields to 1 Target field, based on the condition that field(source) is populated in the target field only if field 1 is null.
Source----->Target
part_id1----
>part_num(if part_id1 is null,then part_id2)
part_id2----
>
I tried using if then else function, it is working fine but errors out when part_id is null....need to make it work even when part_id1 or part_id2 is null.If both fields are null it should not populate anything.The boolean function is not accepting null inputs...
Please, let me know if there is a better way to implement this logic...Thanks a lot!
Regards,
Patrick
Jones,
Have this logic in your mapping:
part_id1>exists>and
part_id1>equals(textfunction)>null(take constant and dont put any value in it)>equals(text funciton)>false
Give the above two to if
Then in the then part give part_id1 and in the else part give part_id2.
So in the above if part_id1 exists and equals to null then part_id2 will be output and part_id1 exists and not equals to null then part_id1 will be the output and part_id1 doesnot exist then part_id2 will be the output.
Regards,
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Patrick,
What u are referring here as null? Please tell on which condition u want to choose part_id2
Please see the below conditions for part_id1
part_id1 -
> Empty
part_id1 -
> null
part_id1 -
> doeesn't exist from source.
Which conditions u will choose!!
best regards,
raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Patric,
I think best and simplest way would be to write a UDF. You can take both source fields as a input to your UDF. Also before assigning source to UDF check for empty.
Process data as per your requirement and conditions.
Then you can result output to target field using result.addValue("Your Value ")
Let me know if you needmore details.
Nilesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jones,
For you problem, Use the EXIST Node function, follow the following logic
part_id1->Exist->IF then part_id1
else part_id2
This will definelty workout.
Warm Regards,
Vijay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Patrick,
Try using the standard Node Function
<b>CreateIF</b>
check this for details on how to use
/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii
Sachin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try like this
Source---Map with default(Null value)-Target
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
8 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.