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!

Sum of a Formula

Status
Not open for further replies.

2ffat

Programmer
Oct 23, 1998
4,811
US
I'm trying to be coherent but it is late and I'm under the gun to get this report done ASAP. (In other words, I desperate!) I am using CR 8.5

I have a report that is left linked between two tables. The first table has multiple records that I am totalling on the first group. The second group is based upon a record in the second table.

The problem is when the second group has multiple records, the total for the first group is multiplied for the group. For example, if there are three records in the second group, the total for the first group is three times the correct amount. I can correct this by dividing the amount by the number of records.

The problem is that I need to total this formula for the report and I can't.

1) How can I get a sum of this formula, or failing that
2) How can I prevent the group total to be a multiple of the second group.

If need be, the company is willing to pay for a consultant but this MUST be done before Friday night.

James P. Cottingham

When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity.
[tab][tab]Albert Einstein explaining his Theory of Relativity to a group of journalists.
 
You need to on use running total fields. Insert, field object, running total field, evaluate on change of group, reset on change of group.

Create another running total field, evaluate on change of group, reset=never to get you grand total that is not inflated.

Let me know if you have any questions. Software Training and Support for Macola, Crystal Reports and Goldmine
251-621-8972
dgilsdorf@mchsi.com
 
Thanks, I tried that but it didn't work. Here is a little more info. I have a formula in the detail of the record that adds three costs together. This is the formula that is multipling for each group 2. I had to create another formula that takes the first formula and divides its sum for group 1 by the number of records in group 2. It is this latter formula that I want to sum but CR won't let me.

If I create a running total on the first formula, I get incorrect results.
James P. Cottingham

When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity.
[tab][tab]Albert Einstein explaining his Theory of Relativity to a group of journalists.
 
Thanks, dgillz. The final solution was to create some variables that would track the numbers correctly.

James P. Cottingham

When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity.
[tab][tab]Albert Einstein explaining his Theory of Relativity to a group of journalists.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top