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

Doing Math with a Summary

Status
Not open for further replies.

TNGPicard

Technical User
Jun 23, 2003
153
0
0
US
Howdy All,

Hopefully a simple question but I'm not finding the answer (and my accounting group is driving me nuts).

I have a report that is listing items sold, no problem. There is a summary on the group that just sums one of the fields. That works, no problem.

Now, they want me to give them another value in the report foot. I want to take the sum, which calculates correctly and subtract that value from 8 and report that number. It could be positive or negative.

In the Formula Workshop I am putting 8-{#RTotal0}, I get 'random' values coming out of the formula, usually 7. If I just put {#RTotal0} to see if thats coming over correctly, I get 1 for most of the values.

There has to be a way to do this, and I'm completly missing it.

Any suggestions?

mark
 
The total for a group is wiped automatically by the next group. What you need to do is a running total for the whole report that accumulates just for the group in question. Best to display its value and check it is OK before doing more maths with it.

The basics of Crystal totals are explained at FAQ767-6524.

It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options.


[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
You need to explain the exact setup of the running total for people to be able to help. You need to use a separate running total for the grand total level, if your original running total is resetting at the group level. You should also clarify whether a grand total running total provides the results you expect or whether you really need to sum the group level running totals in order to get the correct result.

-LB
 
My apologies for lack of details, I thought for sure I had included them but who knows.

I am using Crystal X Developer Edition. I have Crystal XI Developer on order and it should be arriving by Monday.

I have a report with two levels of groupings:
Size
Promotion Code
.....Detail Rows

in the promotion code footer, I have a summary which I used the sum wizard to do for me, it is to SUM the "PiecesOnHand" field that is put in on each detail row - I do not need a grand total in either the size or report footer, only in the promotion code footer. The sum works fine and is not in question.

Where I am getting stuck is I now need, in the PromotionCode group footer, to put the sum AND another value. I simply need to subtract the SUM of pieces on hand from the number 9 and report that number. Herein lies my problem. When I, in a formula put 8-{sumFieldName}, I am getting 1 after 1 after 1 in each group footer. If I take out the math and just try have the output be what the value of that sum is, I get 7, constantly.


MAL
 
The formula should look like this:

9 - sum({table.piecesonhand},{table.promotioncode})

However, you indicated you were using a running total instead of a inserted sum, by referencing a field {#RTotal0}. If you must use a running total, make sure that you have it set up to reset on change of group: Promotion Code.

-LB

 
I need to create a daily detail and summary report in one page that will look like this:

Date: 01-01-2007
Employee: 1234

Detail
Payment code Hours
Pay A 3
Pay B 4
Pay A 5

Summary by Pay

Payment code
Pay A 5
Pay B 4

My question is: How can I create this report by NOT having a sub report for summary by pay?

Thanks!


 
Are you wanting the maximum for "Pay A"? That's one of the totals a Crosstab will show.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
I presented a solution in your other thread.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top