Solved

Sum by Group formula

Posted on 2014-11-11
2
228 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
Comment Utility
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
Comment Utility
Perfect Michael - worked like a charm!!!

Thanks a million!


Steve
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
Hi, In my previous Article  (http://www.experts-exchange.com/Database/Reporting/A_15199-Introduction-to-Microstrategy.html)I discussed some basic understanding of Microstrategy that how we can get in Intro of Microstrategy (MSTR). Now it's tim…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

772 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

9 Experts available now in Live!

Get 1:1 Help Now