Solved

Sum by Group formula

Posted on 2014-11-11
2
234 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Crystal Reports Groups need Hand Cursor on Hover 4 80
SCCM Microsoft Report 2 80
Crystal Reports Version 7 4 33
Crystal reports vb.net 2 54
1. Set up your parameter at the report level as usual, check the box Multi-value, and set the Data Type to String 2. Set the Stored Procedure Parameter to varchar(max)  --<---- This part here is the key to it's success Example:    @cst_key var…
I recently went through setting up a JasperReports Server using the AWS EC2 instance, and this article will cover some basic administration tasks I had to perform.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

828 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