on 11-04-2016 2:30 PM
Hi All,
I am working on UDF for WERKS filed, Kindly suggest the logic for below rule.
The rule is :
if the value is find in the list ("AB01","AB14","AB15","AB16","AB17"), keep the first found in this list and remove the "B" (Example : AB01 -> A01) else force the value to "A22"
so in this case we don’t find any of these values in the list ("AB01","AB14","AB15","AB16","AB17")
.
Thanks in advance..!
Regards,
Srikanth
Hi Srikanth,
Use below UDF.
public String mapWerks(String input, Container container) throws StreamTransformationException {
List<String> list = Arrays.asList("AB01", "AB14", "AB15", "AB16", "AB17");
if (list.contains(input))
return input.replace("B", "");
else
return "A22";
}
Regards,
Praveen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.