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

Summary formula question 1

Status
Not open for further replies.

Harki06

Technical User
May 18, 2006
85
US
I am using Crystal Reports Advanced Developer version 10.0

I have a grouping on Suplr Name and then a grouping on Product TYpe.

Suplr 1 Totalm1
PrevyrTotalm1
Prod Type a Totalm1
PrevyrTotalm1
Prod Type b Totalm1
PrevyrTotalm1

Supr2 Totalm1
PrevyrTotalm1
Prod Type c Totalm1
PrevyrTotalm1
Prod Type d Totalm1
PrevyrTotalm1

Totalm1 is a summary of m1.

PrevyrTotalm1 is a formula which is like this

if Sum ({@m1_number_of_trans}, {Suplr.Suplr_Nm}) = 0
then 0
else
Sum ({@prev_m1_number_of_trans}, {Suplr.Suplr_Nm})

My question is -
The actual fields being summarized are in the detail level. I want to display Summary Totals at Suplr level and Prod Type level.
This formula above specifically states summary at Suplr name level. Do I have to have 2 separate formulas at Prod Type and Suplr level??
If I remove the qualification of Suplr Name it takes the last total.Is this the only way?? Is there a way to use one formula which automatically takes the sum at the group level that the formula exists in? Currently I have the formula at the Suplr level and want totals at Prod Type level too.

Thanks!
 
Yes, you will have to change the group condition for the product level, as in:

if Sum ({@m1_number_of_trans}, {table.prod_type}) = 0
then 0
else
Sum ({@prev_m1_number_of_trans}, {table.prod_type})

-LB
 
LB,

Thanks! Are you saying I have to define 2 formulae - one at each group level?

 
Thanks a lot. I was trying to avoid that-:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top