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

Count once in a running total

Status
Not open for further replies.

Pamula

Technical User
Aug 15, 2006
6
US
I am quite new to Crystal and found the solution to my 'problem' on this web site. However, I am a little confused.

I have a group for PurchOrder. Within that group I have POLINE table information. Because of the way the tables work, I have to pull the PO Total from the PurchOrder table and it prints for each line on that PO. I need to display the PO Total only once, and use it to summarize the totals by another group in the report (buyer).

The running total seemed to be the easiest because it will give me the summary I need, but I need to evaluate the running total on a formula to count the PO Total only once. I cannot figure out how to do that and couldn't find anything listed.

Can someone please help with this evaulation formula?

Thanks in advance!
 
Your post is a tadf comfusing, such as " I need to display the PO Total only once, and use it to summarize the totals by another group in the report (buyer)."

You defined your grouping once, then off handedly mention that there's another group, somewhere...

Try posting technical information:

Crystal version
Database/connectivity
Example data
Expected output

-k
 
Sorry about the confusion.

Crystal 9 is the version.

I have two tables:
POLINE where I get line detail from, and from POLINE I link to PURCHORDER where I get the PO date and Print total.

I group the report by buyer and I need a total dollar value for all PO's issued by a specific buyer within a date range (determined when the report is run). This total dollar value is the sum of the PO Print total.

Within the buyer group, I have the report grouped by PO number. Here is an example of what it looks like within this PO Number group:

PO #123 Line 1: 4ea Catheter at $100/ea PO Print total: 456.00
PO #123 Line 2: 4ea Stent at $14.00/ea PO Print total: 456.00

Because of how the data must be pulled, the PO Print total is attached to each line on the PO. When I do a running total (to get a PO Print total by buyer for all PO's they do), it sums each time the print total displays. In this case, the running total says $912.00. I need it to only sum the total once per PO -- so it says $456.00.

Hoping this helps.
 
You have options here, and if I understand you correctly, you should use a manual formula.

In the Buyer Group Header place:

whileprintingrecords;
numbervar MyTotal:=0

In the PO Group Footer place:

whileprintingrecords;
numbervar MyTotal:=MyTotal + maximum({table.pototalamount},{table.PO})

In the Buyer Group Footer place (this is where you display the total):

whileprintingrecords;
numbervar MyTotal

-k
 
I have no idea how it worked, but it did. Thanks Tonz!
 
In the Buyer Group Header I reset a variable to add in the POs for that buyer.

In the PO Group Footer, I take 1 of the values for the PO Total (hence the maximum), and add it to the buyer level variable.

In the Buyer group footer, we display the variable, then it goes back up to the buyer group header, resets the variable and starts again.

Hope that clarifies.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top