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

Formula to change certain words in the detail field

Hi All,

I want to know how to use a formula to identify certain words in the detail field, and change those words to something else. For example, the detail field, under the heading of toys, contains trains, airplanes, and cars. I want a formula that changes ever occurrence of "trains" to "bikes," and every "airplane" to "ships." How do I do that?

Secondly, some data have excessively long names that I want to truncate, for example, "ABC bank - XY branch." I need a formula that cuts off everything after the "-", how do I do that?

Thank You in advance!

Frank

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 09, 2008 at 01:28 AM

    Try using the function replace() to replace the text in the field like this

    replace(,"trains","bikes") and for runcating the text use the function split() split(,"-")[1]

    Hope this helps!

    Raghavendra

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 14, 2009 at 11:20 PM

    Hi All again,

    Along the line of this question, let's say I have a detail field that displays a date of when a product is sold. But instead of displaying the date sold, I just want to replace the date with a simple "SOLD." How do I do that?

    I want the word "SOLD" to be displayed everytime the detail field displays a date.

    Additionally, I'm awarding my sales staff with a $200 bonus for every sale, so how do I create a detail field that displays the $200 bonus every time the world "SOLD" is displayed? I'd also want to create a summation of all the bonus awarded as well.

    Please help. Thanks,

    Frank

    Edited by: CRXI Newb on Jan 15, 2009 1:48 AM

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Frank

      As I understand you want to display the name as "SOLD" if it is date sold To do this mentioned below are the steps.

      1) You have inserted the fiekld in the detail section.

      2) Right Click the particular field> Select Format Editor> Click on Common tab> In the second pane click on "X-2" button infront of Display String.Here you need to write formula:

      3) if <database field>= "date sold" then "SOLD" else "NOT SOLD".

      SOLD is the static name given if condition satisfied.

      Hope this will help you.

      Regards

      Asha.

  • author's profile photo Former Member
    Former Member
    Posted on Jan 15, 2009 at 12:16 AM

    I need additional help on this topic. Thank You.

    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.