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

Need help creating addition formula

Status
Not open for further replies.

ergibbs

Technical User
Oct 18, 2005
2
US
I've tried searching various forums, but haven't had much success locating a solution to this. I have created a report that lists inventory items, and then categorizes them using some conditional formulas. However, I cannot figure out how to total each category, since I've only manually grouped the items. I'm not sure how to total the corresponding quantities without completely changing the structure of the report. Thanks for any assistance.
 
You can get quicker help if you have the following included with your post.

Crystal Version
Type of Database and connectivity
Sample of your input
Sample of your expected output
Any of the formulas, sql expressions, or record selection that is causing the problem

-lw
 
right click the field that you want totalled, select insert, summary, and choose the category you want this field to be summed by. If you do not already have a group by this category, the summary operation will create one.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
Do a set of running totals for the whole report. Give each a formula that selects one of your 'manual groups'.

Right-click on a field and choose Insert to get a choice of Running Total or Summary. Or else use the Field Explorer, the icon that is a grid-like box, to add running totals.

Running totals allow you to do clever things with grouping and formulas. They also accumulate for each line, hence the name. The disadvantage is that they are working out at the same time as the Crystal report formats the line. You cannot test for their values until after the details have been printed. You can show them in the group footer but not the group header, where they will be zero if you are resetting them for each group.

Summary totals are cruder, but are based directly on the data. This means that they can be shown in the header. They can also be used to sort groups, or to suppress them. Suppress a group if it has less than three members, say. They default to 'Grand Total', but also can be for a group.


[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thanks for the replies.

Sorry about leaving out the requisite info - my mind isn't what it used to be (although I'm not sure what it used to be was all that good either!). I'm using Crystal 8.5 with an application called Vista.

The inventory items amount to stops on a bus route. Each route typically has 3 or 4 stops, but the inventory items are just line items - meaning, route 1/stop 1, route 1/stop 2, etc. I can generate a summary of passengers for each stop and, obviously, a grand total for the report. However, what I'm not able to accomplish is a total for each route. Since the only group is the Inventory name, I'm not sure how to create a solution to only tally stops for route 1, stops for route 2, etc. I created some formulas to re-title the group header, because the inventory name in the database provides more info than I wanted on the report (IF ({INVNTORY.Name}) = "Route 1/Stop 1 Shadowood Plaza 08:10AM" THEN "STOP 1 - SHADOWOOD PLAZA, BOCA RATON" ELSEIF...). I was then able to structure the report properly, with the exception of summarizing the number of passengers for each route.

I hope this is enough information. Thanks again for your help.
 
For each route, have a running total with an 'evaluate formula'. In the middle section of the running total, have an evaluation formula checking for just that route.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
You could just create one detail-level formula per route like:

if {inventory.name} startswith "Route 1" then {table.passengernumber}

Then you can right click on each formula and insert a grand total. Conditional formulas run faster than running totals, although running totals will work, too. If you have record inflation, then running totals are the way to go.

-LB
 
I’ve got the following very irritating problem…

I’ve got a table with 2 fields, account number and balance;
Account Balance
A 100
B 200
C 300
D 400
E 500
F 600

On my report I only want account D, E and F (in that order) and the balance next to it;

When the report gets to account E it should take the value of E (500) and add the running total of account A to C to it [500 + (100+200+300)] = 1100

The report should look like this….
D 400
E 1100
F 600

I’ve added a running total for A, B & C (RunTotal) and changed the formula for the balance to…
If Account = “E” then
Formula = Balance + RunTotal
Else
Formula = Balance
End if

But I get the following error ...“A running total cannot refer to a print time formula”
I know that is because the value calculated is not calculated at a time that the running total needs it….but how do I get around it?

I don't think it's possible to use a summary since the balances to be summarized are not included on the report;

Any help would be most welcome
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top