on 12-08-2015 11:39 PM
Hello All,
Could anyone help me with UDF to get the string before pipe.
I have a requirement where data will populate as below
Source data: Human Resource | Administration ---> Output i need to get is Human Resource
Finance Accounting | Finance ---> Output i need to get is Finance Accounting
Sales | Representatives ---> Output i need to get is Sales
Communications | Community Relations ---> Output i need to get is Communications
If there is no Pipe then i need to pass data as it is which is coming from source field.
For Ex: Manufaturing ---> output is Manufacturing.
Production ---> Output is Production.
Can anyone help me with UDF or if it is achievable with graphical function kindly let me know how to do.
Thanks,
Bhaskar
Hi Bhaskar,
Just use a single values udf.
Argument is inp type String
Here is the code:
if(inp.indexOf("|")>-1){
String tmp[] = inp.split("\\|");
return tmp[0].trim();
}
else{
return inp;
}
Regards,
Mark
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 | |
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.