on 06-15-2011 1:28 PM
Hi All need assistance in a UDF ....
I need assistance in cracking this logic via UDF
element TEST can have values a,b,c,d.........q , now the logic is
if TEST = a or b or c or d....... or q , then send a send a constant to target field TARGET.
TEST-UDF(checking for a OR b OR c OR... OR q)- if -
Thanks
Kiran
Hi All need assistance in a UDF ....
>
> I need assistance in cracking this logic via UDF
>
>
> element TEST can have values a,b,c,d.........q , now the logic is
>
> if TEST = a or b or c or d....... or q , then send a send a constant to target field TARGET.
>
> TEST-UDF(checking for a OR b OR c OR... OR q)- if -
then---CONSTANT = TARGET.>
> Thanks
> Kiran
assuming your input is 'in' then
String constant = "ABCD";
if(in.equals("a") || in.equals("b") || ...... in.equals("x"))
{
return constant;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just to add some point to Shabarish, you can make use of String function indexOf(). Assuming your input is
String constant = "XYZ";
String chkString = "abcdefghijklmnopq";
if(chkString.indexOf(in) >= 0)
{
return constant;
}
Regards,
Saptak
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
71 | |
26 | |
10 | |
9 | |
7 | |
6 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.