Skip to Content
author's profile photo Former Member
Former Member

UDF Required to get string before Pipe

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.



Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Dec 09, 2015 at 01:19 AM

    Hi Bhaskar,

    Just use a single values udf.

    Argument is inp type String

    Here is the code:


    String tmp[] = inp.split("\\|");

    return tmp[0].trim();



    return inp;




    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.