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

crystal report - sum(count) problem 1

Status
Not open for further replies.

Johalak08

Programmer
Aug 1, 2008
14
CA
I have report which has columns:
Shipment WorkDays Shipment/Diem
9 22 0.41
10 20 0.50
3 22 0.14
5 21 0.24

To calculate shipment/Diem column i used the formula
-- Count ({spSalesReportByBillTo;1.WaybillNumber}, {spSalesReportByBillTo;1.Date}, "monthly")/{@Work_Days} --

My question is, how can i get the total of the Shipment/Diem column? If i try to use SUM, i am getting the error "cannot create summary/running totals.."

Please help. You're reply will greatly be appreciated. Thank you.
 
You could use a variable. Create a formula like this:

whileprintingrecords;
numbervar sumship := sumship + {@shipment/diem};

Place this in the section containing your {@shipment/diem} formula. Then create a formula for the report footer:

whileprintingrecords;
numbervar sumship;

If you are trying to summarize the formula at a group level instead of at the report level, then you would need a reset formula in the group header:

whileprintingrecords;
numbervar sumship;
if not inrepeatedgroupheader then
sumship := 0;

-LB
 
Hi LB:

i did what you have advised and it works great.
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top