on 11-19-2013 12:05 PM
hi
We have a field TEST - when it comes as a three character string of the same value (AAA, BBB, bbb,ccc etc.) -small or CAPS same value - we need to pass NULL for it.Otherwise watever value comes it shud pass.
can u please share UDF to be written for it.
rgds
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
The mapping provided will only pass all characters that have a length > 3, if you will be checking for duplicates add this mapping after remove context: sort:lexicographical ascending -> splitByValue:ValueChanged -> collapseContext ... That logic will ensure that only unique values are passed.
Regards,
Mark
Hi,
I agree with Iñaki, the best solution is using pattern. Take the first character of TEST and check if the pattern matchs.
So:
String inputText= "bbb"; | ||
Pattern p = Pattern.compile(inputText.substring(0,1)+"{3}"); //The patter is first letter{3} | ||
Matcher m1 = p.matcher(inputText); |
If m1.matches() | ||
return null; |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Create a udf with string input var1 and the following code:
String strVal = var1.toLowerCase();
if(strVal.length() != 3) return var1;
for(int i = 0; i < strVal.length() - 1; i++){
if(strVal.charAt(i) != strVal.charAt(i+1)) return var1;
}
return null;
Regards,
Koen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If i understand right you need to search a pattern inside the string. I recommend you to use regular expresions for your UDF, check this link http://www.tutorialspoint.com/java/java_regular_expressions.htm
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.