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!

Average value of fields summarized in a group header

Status
Not open for further replies.

darrenlee

MIS
May 21, 2009
1
GB
Hi there,
I have 2 grouped headers.
Customer Group Header #2
Order Number Group Header#

I have a details section that shows the shipment value of each line of an order called Sales_order_detail.shipment_value ( This section is hidden)

I then have a formula that sums the Shipment Value= sum({Sales_order_detail.shipment_value}) and placed this formula in group 2 which shows the total sum of the shipment value for each order.

What I want to do is show the average of sum of the shipment value in the Customer group header#



Group#1 Customer Average £44.6

Group#2 Order 1 Total value £50
detail Line 1 Ship value £20
detail Line 2 Ship value £30

Group#2 Order 2 Total Value £29
detail Line 1 Ship value £10
detail Line 2 Ship value £19

Group#2 Order 3 Total Value £55
detail Line 1 Ship value £30
detail Line 2 Ship value £25

Home I have explained this correctly.

Thankyou in advance

Darren
 
You should be able to do this with summary totals, which are usually placed in the footer, but can be moved to the corresponding header. The use of Crystal's automated totals is outlined at FAQ767-6524.

It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options. In this case, it probably makes no difference.


[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Your group#2 formula should be:

sum({Sales_order_detail.shipment_value},{table.ordernumber})

Use a formula like this in your group #1 header:

sum({Sales_order_detail.shipment_value},{table.customer)}/distinctcount({table.ordernumber},{table.customer})

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top