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

Summarising Groups 2

Status
Not open for further replies.

sjdbmc

IS-IT--Management
Jan 30, 2004
14
GB
I am attempting to work out whether we have attended a job when we said we would attend a job and calculate %'s from it.

I have 2 tables order_line and demand.

Order_line contains details of the job and Demand contains the activities carried out on the job (1 to many)

The attend by date is in order_line so no problem there.

To calculate when we actually attended the job I have taken the start dates of the individual activities and returned the minimum date.

I have placed these fields / formula in the Group Header and can work out if we have attended on time (Yes or No).

This has returned a list of group headers / detail suppressed with Yes or No for each header.

How can I now calculate how many Yes's and No's appear and show percentages of the total groups.

Any help would be greatly appreciated.


sjdbmc
 
sjdbmc,

You could create formulas to allow counts of Yes and No groups.

//@OnTime
if @AttendOnTime = "Yes" then
1
else
0


//@NotOnTime
if @AttendOnTime = "No" then
1
else
0


Then insert a Summary or Running Total for both of these formulas to get "Yes" and "No" totals.

To get averages:

//@AvgOnTime
( Sum of @OnTime / (Sum of @OnTime + Sum of @NotOnTime)) * 100

//@AvgNotOnTime
( Sum of @NotOnTime / (Sum of @OnTime + Sum of @NotOnTime)) * 100


Insert your formula names to these examples.
 
campsys

Thanks for response.

All of my info is in the group header of order_id.

The Yes or No in calculated on the group info not the detail.

All of the detail is suppressed, so I need to summarise the group headers.


example


GH YES
GH YES
GH YES
GH NO
GH NO
GH YES
GH NO
GH YES
GH NO

From this how I show a footer that shows On time = 5 anf Not on time = 4

sjdbmc





 
sjdbmc,

To get counts in the group header try using variables. Place these formulas in the group header. When you are sure the variables are counting correctly you can surpress these fields so they do not display on your report.

//@OnTimeCount
Whileprintingrecords;
if {YourFormula} = "Yes" then
Numbervar OnTimeCount:= OnTimeCount + 1;
Numbervar OnTimeCount;

//@NotOnTimeCount
Whileprintingrecords;
if {YourFormula} = "No" then
Numbervar NotOnTimeCount:= NotOnTimeCount + 1;
Numbervar NotOnTimeCount;


Place these formulas in the report footer to display the count totals.

//@OnTimeTotal
Whileprintingrecords;
Numbervar OnTimeCount;


//@NotOnTimeTotal
Whileprintingrecords;
Numbervar NotOnTimeCount;


 
Works like a charm

Much appreciated

Stuart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top