Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Sum of the group based on condition

Posted on 2011-02-14
2
Medium Priority
?
697 Views
Last Modified: 2012-06-27
I need to calculate the sum of the group1 in crystal report.The report is like this.
Group1 is TypeID
Group2 is MemberID
Group2 has Details section.It has fields like Name,TransactionDate and Balance.

It looks as follows:
Group1Header TypeID
Group2Header MemberID
Details Name  Transactiondate   Balance    
           123        02/13/2011          $100  
           123        02/13/2011          $100
Group2Header MemberID
Details Name       Transactiondate   Balance    
                 345        02/13/2011        $200  
                 345        02/13/2011        $200
                 345        02/13/2011        $200
Group2Header MemberID
Details Name       Transactiondate   Balance    
                   ----         ---------                 ----
Group1Footer Sum for Group1 Sum(Balance)= $300

The sum has to consider only one record in each details section.Because the balance is repeating for the same member.
So, I need to consider it only once.
How to do this. Please let me know.

Thanks
0
Comment
Question by:KavyaVS
[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 101

Assisted Solution

by:mlmcc
mlmcc earned 400 total points
ID: 34893130
Try this

Add a formula to the group 1 header
WhilePrintingRecords;
Global NumberVar grpTotal;
grpTotal := 0;
""

IN the group2 header add a formula
WhilePrintingRecords;
Global NumberVar grpTotal;
grpTotal := grpTotal  + {BalanceField};
""

In the group1 footer
WhilePrintingRecords;
Global NumberVar grpTotal;
grpTotal

mlmcc
0
 
LVL 35

Accepted Solution

by:
James0628 earned 1600 total points
ID: 34894639
You could also use a running total.  Right-click on the Balance field and select Insert > "Running Total".  Under Evaluate, select "On change of group" and select group 2.  Under Reset, select "On change of group" and select group 1.  Click OK to add the running total field and put it in your group 1 footer.

 James
0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

670 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