on 12-09-2008 12:58 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raghavendra,
Thank You for your answers! They work, but I want to take the "replace" command and replace more than one key word in the data field. replace(,"trains","bikes") worked wonders for trains and bikes, but how do I include "airplanes", and "ships" in the same formula?
thank you!
Frank
I need additional help on this topic. Thank You.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
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.