Solved

Sum by Group formula

Posted on 2014-11-11
2
239 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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 2008 6 47
Printing duplex pages and have a page break 6 61
business objects to connect to MSSQL 6 113
Join Number Parameter with commas 8 37
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…
Hello, In my precious Article  (http://www.experts-exchange.com/Database/Reporting/A_15280-Create-Project-in-Microstrategy-Part-I.html)we saw the Configuration part for Microstrategy which included Metadata Creation and DataSource Preparation as …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

752 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