Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

records being ignored by formula 2

Status
Not open for further replies.

cjbrown815

IS-IT--Management
Mar 2, 2006
525
US
Hello,
I have a field {SAMPLE.TEXT4} that represents the TANK# however the associates are not very consistant with their data entry. I need to seperate out the entries by tank number. to do this I wrote the formula below, but I know there are records with the numeric value I'm looking for but they are being ignored. There must be a better way. thanks for the help. I'm doing this for a line graph

FORMULA
If {SAMPLE.SAMPLE_TYPE}= "SPC-BOD-Conc Strg Tk" and {SAMPLE.TEXT4} in "%902%" then "BOD Tk 902" else
If {SAMPLE.SAMPLE_TYPE}= "SPC-BOD-Conc Strg Tk" and {SAMPLE.TEXT4} in "%903%" then "BOD Tk 903" else
If {SAMPLE.SAMPLE_TYPE}= "SPC-BOD-Conc Line" then "BOD Con Line"


DATA EXAMPLES
TK 902
TANK#902
903
TK# 903



-CJ

SQL2005// CRXIr2// XP Pro

"Progress lies not in enhancing what is, but in advancing toward what will be"
-KHALIL GIBRAN 1883-1931
 
Hi,
use LIKE not IN with wildcards:
Code:
If ({SAMPLE.SAMPLE_TYPE}= "SPC-BOD-Conc Strg Tk" and {SAMPLE.TEXT4} like "%902%")
 then
 "BOD Tk 902"
 else
If ( {SAMPLE.SAMPLE_TYPE}= "SPC-BOD-Conc Strg Tk" and {SAMPLE.TEXT4} like "%903%" )
 then
 "BOD Tk 903" 
 else
If {SAMPLE.SAMPLE_TYPE}= "SPC-BOD-Conc Line" 
 then
  "BOD Con Line"



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
...and unless you are using a command, you should be using '*' for wildcards, not '%'.

-LB
 
Thank you, the formula worked great.

@LB The wildcard rule I will not forget.

thanks again.

-CJ

SQL2005// CRXIr2// XP Pro

"Progress lies not in enhancing what is, but in advancing toward what will be"
-KHALIL GIBRAN 1883-1931
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top