on 04-13-2009 7:20 AM
How to perform the following mapping using standard graphical functions:
if (a = 1)
result.addValue("3");
else if (a = 2)
result.addValue("6");
else if (a = 5)
result.addvalue("7");
else if (a = 10)
result.addValue("11");
else
result.addValue(a);
can this requirement be acheived without using a UDF?
Regards
bhasker
Hi,
It is not necessary to use UDF always. I know java i can write a Java code for any of complex or simple scenario. But what if people don't know basic java. So they will must go with standard mapping, so i guess what you want to know.
In your requirement.
If a = 1
use ifElse component in ur grafical mapping
give constant a value as 1.
then check if A.EqualS(1). EqualS is a standard function given in XI. If equal give the value you want to first success condition.
Fo second condition
add one more IFElse.
Check it until you done. and provide values in first and sencond success. provide the output to above second success of IF recursively.
I don't have any snap right now.
May be like this
Field | _ Equals - If - Success - Value | Final value -
Final field
Constant | - Output value |
field | _ EqualS - If -Success - value | _ Output value
Constant | else Constant - xyz |
I don't know if i am clear but you can try like this.
Regards
Aashish Sinha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear ALL
Thank u for your suggestions and feedback.
Dear Aashish
if you can provide a screen shot or link to such mapping it would be of great help.
i am able to check the first IF condition but how to map the ElSEIF ...........ELSEIF loop in the mapping ?
Only IF is enough or should we use IFs standard function
Regards
Bhasker
UDF is better way to get this done.
you try like this using Standard function:
Const 3 /THEN
(A equals 1) IF (output of ifThenElse) ->TragetFiled
\ELSE
/THEN /(output of IfThenElse input to else of first If)
IF /
\ELSE
Like wise for other conditions....
In else part of ifThenElse, give the output of second ifThenElse. here in ths case you need four ifThenElse.
CodeGenerated:
/ns0:MT_/targetFIELD = iF(const([value=3]), stringEquals(/ns0:MT_XML_OB/A=, const([value=1])),
iF(const([value=6]), stringEquals(/ns0:MT_XML_OB/A=, const([value=2])),
iF(const([value=7]), stringEquals(/ns0:MT_XML_OB/A=, const([value=5])),
iF(const([value=11]), stringEquals(/ns0:MT_XML_OB/A=, const[value=10])), /ns0:MT_XML_OB/A=))))
Ritu
Edited by: Ritu Sinha on Apr 13, 2009 2:48 PM
Hi
You can do with standard xi functions also.
but better use UDF it looks neat and straight forward and readable for further changes.
If done with MM takes time to understand what is logic than UDF
srini
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Bhasker,
Did you do some R&D with the standard mapping functionalities given. If that does not solve your problem than i guess UDF is the way out.
Regards
joel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
U Should use UDF for this
Rajesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.