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!

Formula not filtering bad data

Status
Not open for further replies.

cjbrown815

IS-IT--Management
Mar 2, 2006
525
US
Hello,
I have two formulas to bring in specific sample types into two line graphs {@EOD TANKS} and {@BOD TANKS}. The problem is:
The line graphs are still showing sample types that I am not specifying in the formula. I only want lines for the sample types I'm asking for in the formula. What am I missing?

grouping by DATE1 (production date)

Line graph A is located in section RHb
The graph is changing on DATE1 & @EOD TANKS-A

Show values
Sum of @XRESULTS



Line graph B is located in section RHc
The graph is changing on DATE1 & @BOD TANKS-A

Show values
Sum of @XRESULTS


Formulas
@EOD TANKS
If ({SAMPLE.SAMPLE_TYPE}= "SPC-EOD-Conc Strg Tk" and {SAMPLE.TEXT4} like "*902*")
then
"EOD Tk 902"
else
If ( {SAMPLE.SAMPLE_TYPE}= "SPC-EOD-Conc Strg Tk" and {SAMPLE.TEXT4} like "*903*" )
then
"EOD Tk 903"
else
If {SAMPLE.SAMPLE_TYPE}= "SPC-EOD-Conc Line"
then
"EOD Con Line" else "Bad Data"


@BOD TANK
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" else "Bad Data"


@XRESULTS
if isnumeric({SAMPLEPARAM.SRESULT}) then
val({SAMPLEPARAM.SRESULT})
else
if left({SAMPLEPARAM.SRESULT},1) = "<" then
0
else
val(mid({SAMPLEPARAM.SRESULT},2))


Thanks,

-CJ

SQL2005// CRXIr2// XP Pro

"Progress lies not in enhancing what is, but in advancing toward what will be"
-KHALIL GIBRAN 1883-1931
 
Hi,
You need to add a record seelction formula to limit the types returned ( in addition to the formulas you have to determine what to display as a type)..
Try:

Code:
{SAMPLE.SAMPLE_TYPE}= "SPC-EOD-Conc Strg Tk" 
and
 (
{SAMPLE.TEXT4} like "%902%"
 OR
{SAMPLE.TEXT4} like "%903%" 
)

With this as a record selection formula, only those tank types will be returned from the data source.

[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
This is my record select at the report level.

{SAMPLE.DATE1} >= currentdate-90 and
{SAMPLE.DATE1} <= currentdate and
{SAMPLEPARAM.PA_NAME} in ["SPC-Ct"] and
{SAMPLE.SAMPLE_TYPE} in ["SPC-BOD-Conc Line", "SPC-BOD-Conc Strg Tk", "SPC-EOD-Conc Line", "SPC-EOD-Conc Strg Tk"] and
{SAMPLETYPE.ST_TYP} = "WHEY-BACT"


How do I incorporate the select formula at the graph level?

thanks

-CJ

SQL2005// CRXIr2// XP Pro

"Progress lies not in enhancing what is, but in advancing toward what will be"
-KHALIL GIBRAN 1883-1931
 
Hi,
I am not clear about what your formulas are trying to show? Are you using the formulas to designate the lines identity?
Do you want 'Bad Data' to be graphed as well as the tank types? If not, then try:
Code:
@EOD TANKS
If ({SAMPLE.SAMPLE_TYPE}= "SPC-EOD-Conc Strg Tk" and {SAMPLE.TEXT4} like "*902*")
 then
 "EOD Tk 902"
 else
If ( {SAMPLE.SAMPLE_TYPE}= "SPC-EOD-Conc Strg Tk" and {SAMPLE.TEXT4} like "*903*" )
 then
 "EOD Tk 903"
Code:
@BOD TANK
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"



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Thanks,
Are you using the formulas to designate the lines identity?
Yes

When I use the formulas I get a line that has no label. If I add the else "Bad Data" the formula returns the same line but now labeled "Bad Data". When I look at the raw values, this data line is coming from sample types that should be on the other graph only. the graphs are not filtering on just the sample types I'm trying to identify using the formulas. Thank you for your patience

-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