Crystal Reports - Formula - Need to do a custom summary

Hi. I have a report formatted like this: (group within a group)


CompanyA
...........InvoiceA
......................1..................23
......................5..................23
......................3..................23
......................4..................23
...........InvoiceB
......................6..................45
......................2..................45
......................1..................45
......................1..................45
................................ ||The spot||
CompanyB
...........InvoiceC
......................1..................55
......................9..................55
......................3..................55
......................1..................55
...........InvoiceD
......................6..................88
......................3..................88
......................3..................88
......................1..................88
................................ ||The spot||


I need to create a formula that sums the numbers (23 and44) and then (55 and 88).

As you can see these numbers are unique to the invoice, not to each line under an invoice.

The areas above that I have marked ||The Spot|| should read "68" and "143" respectively

I need a formula kind of like this:

Sum of InvoiceTotals for each Invoice where CompanyID = "companyA"

The "hitch" is that the details section of the report is Invoice Line Items -- so inevitably crystal grabs the value too many times for a normal summary (one time for each invoice line item)

Any ideas?

Thanks
hamlin11Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mlmccCommented:
Try this using formulas a variables.

Add formulas in the specified sections
In the report header
WhilePrintingRecords;
Global NumberVar CompanyTotal := 0;
''

In the Company group header
WhilePrintingRecords;
Global NumberVar CompanyTotal;
CompanyTotal := 0;
''

In the Invoice groyp header
WhilePrintingRecords;
Global NumberVar CompanyTotal;
CompanyTotal := CompanyTotal + {InvoiceTotalField};
''

In the Company Group footer
WhilePrintingRecords;
Global NumberVar CompanyTotal;
CompanyTotal

mlmcc
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
hamlin11Author Commented:
I'm going on the road for a few hours - I'll attempt it as soon as I get back to the office. Thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
DB Reporting Tools

From novice to tech pro — start learning today.