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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Percentage of failed results in a manula XTAB

Status
Not open for further replies.

cjbrown815

IS-IT--Management
Mar 2, 2006
525
US
Hello,
I have a manual XTAB that is grouped by Product type and Quality Code. It also has background formatting for out of spec result alerts.

//H2O ~Mozz
if {@Product Type} like "*MozzPS*" and
val({#Moisture}) in 1.50 to 5.50 then crWhite else
if {@Product Type} like "*MozzWM*" and
val({#Moisture}) in 2.50 to 6.50 then crWhite else

When a sample is out of spec, we want to see what percentage of samples submitted for the year are OOS.

So I have to count the total number of sample_id's submitted with that Product type and divide it by the number of failed OOS. How can I do this? I'm lost on the lay-out :(

thanks

-CJ

SQL2005// CRXIr2// XP Pro

"Progress lies not in enhancing what is, but in advancing toward what will be"
-KHALIL GIBRAN 1883-1931
 
How does the sample ID field relate to the two group fields? On what section is your color formula applied? Does "white" mean the item is "in spec" or "out of spec"? How is the running total set up and why does it need to be wrapped in val()?

Please show some sample data.

-LB
 
1)The sample_ID is the unique identifier for each record. Quality code and Product type is not unique to a single record. I thought that would be the best way to get my total samples submitted for that product type.

2) The GF of @Quality Code-A

3) White means it's "in spec" I have the background set to red

4) The running totals are Type of summary "Maximum" Evaluate for each record, change on group @Quality Code-A

5) as for the code. I dont remember, I had an issue with this report and you resolved it!! BTW - thanks again


The data is a string field, its returning 2 place decimals "0.00"

-CJ

SQL2005// CRXIr2// XP Pro

"Progress lies not in enhancing what is, but in advancing toward what will be"
-KHALIL GIBRAN 1883-1931
 
The running total is unnecessary. You could instead use:

maximum({table.moisture},{@Quality Code-A})

...where {table.moisture} is the field you are summarizing in the running total.

In the GF#2, place a formula like this:

whileprintingrecords;
numbervar oos;
if not(
(
{@Product Type} like "*MozzPS*" and
maximum({table.moisture},{@Quality Code-A}) in 1.50 to 5.50
) or
(
{@Product Type} like "*MozzWM*" and
maximum({table.moisture},{@Quality Code-A}) in 2.50 to 6.50
)//etc
) then
oos := oos + 1;

Add a Reset formula in the group header #1:
whileprintingrecords;
numbervar oos;
if not inrepeatedgroupheader then
oos := 0;

In the group footer #1, use a formula like this:

whileprintingrecords;
numbervar oos;
oos % count({table.sampleID},{table.ProductType})

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top