on 11-10-2008 3:36 PM
Hi All,
Can anybody please help me with the UDF with the below conditions:
The input is say 'X' and if X is equals to some specific numbers like US0004, US0007, US0009, US0045, US0058, US0065, and US00090 till US0099 then the output should be 1 and any numbers except the mentioned above(like US0001, US0002,and so on) the output should be '2'
Many Thanks,
Smith
Hi,
Create Simple UDF type
If( input_field.equals("US0004") || input_field.equals("US0007") || ............)
{
return "1";
}
else return "2";
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pedro,
I know we could use fix values standard function. But, i have only to check for only one condition for all numbers from 1 to 100 and i thought it would be complex.
@ Unni Krishnan , Venkataramesh , Thanks, I tried your code but unfortunately, it is not working
Any other options please?
Cheers, Smith
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Paul,
I changed the Unni code as Stirng temp = st open squarebracket i closesquarebracket..
Whether it is US00090 or US0090. Change according to your values in String array list.
public String checkInput (String value){
String flag = "2";
String[] st = {"US0004", "US0007", "US0009", "US0045", "US0058", "US0065",
"US0090", "US0091", "US0092", "US0093", "US0094", "US0095", "US0096",
"US0097", "US0098","US0099"};
for(int i=0; i < st.length; i++){
String temp = st<i>;
if (temp.equals(value)){
flag = "1";
break;
}
}
return flag;
}
NOw check the code once and let me know if any modifications required.
Regards
Goli Sridhar
The function by Unni Krishnan, with a little correction:
public String checkInput (String value){
String flag = "2";
String[] st = {"US0004", "US0007", "US0009", "US0045", "US0058", "US0065",
"US00090", "US00091", "US00092", "US00093", "US00094", "US00095", "US00096",
"US00097", "US00098","US00099"};
for(int i=0; i < st.length; i++){
String temp = st<i>;
if (temp.equals(value)){
flag = "1";
break;
}
}
return flag;
}
public String checkInput (String value){
String flag = "2";
String[] st = {"US0004", "US0007", "US0009", "US0045", "US0058", "US0065",
"US00090", "US00091", "US00092", "US00093", "US00094", "US00095", "US00096",
"US00097", "US00098","US00099"};
for(int i=0; i < st.length; i++){
String temp = st<i>;
if (temp.equals(value)){
flag = "1";
break;
}
}
return flag;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
Any help on this would be greatly appreciated as i have stopped my testing only for this UDF.
Cheers,
Smith
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.