Solved

Sum by Group formula

Posted on 2014-11-11
2
230 Views
Last Modified: 2014-11-11
Gurus,

I have a subreport passing out a variable to my container report in the detail area called:

TotalPremiumValue

WhilePrintingRecords;
Shared NumberVar TotalPremiumValue;
TotalPremiumValue


I'm having trouble summing this variable for each group.  (I need to do a simple math total there).  TotalPremium / # of Events


2013
    Event 1 - Total Premium Value = $100,000 (Got this variable)
    Event 2 - Total Premium Value = $200,000

    Total Premium Value for 2013 = $300,000 - - - - I can't get this
    Total Premium per Event = $150,000


I'm really bad at Crystal variables so any help would be great!  Thanks!!!

Steve
0
Comment
Question by:SStroz
2 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 40435844
In the year group header add a formula
WhilePrintingRecords;
Shared NumberVar TotalPremiumValue;
Global NumberVar YearTotal;
 TotalPremiumValue := 0;
YearTotal := 0;
''

Open in new window


You need a formula in a section AFTER the subreport to do the totals.(perhaps the display formula)
WhilePrintingRecords;
Shared NumberVar TotalPremiumValue;
Global NumberVar YearTotal;
YearTotal := YearTotal + TotalPremiumValue;
TotalPremiumValue

Open in new window


In the YEAR group footer Add a formula to display the year total
WhilePrintingRecords;
Shared NumberVar TotalPremiumValue;
Global NumberVar YearTotal;
YearTotal

Open in new window


mlmcc
0
 
LVL 7

Author Closing Comment

by:SStroz
ID: 40436114
Perfect Michael - worked like a charm!!!

Thanks a million!


Steve
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now