Print Page | Close Window

sum of value based on criteria

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=2714
Printed Date: 04 May 2024 at 12:24pm


Topic: sum of value based on criteria
Posted By: bobby_macnair
Subject: sum of value based on criteria
Date Posted: 26 Mar 2008 at 5:28am

Hi all,

Im creating a report in designer and have come across a very simple problem im sure.

The data returned includes many accounts, and values associated with the accounts (debit, credit, closing balance etc).
 
All i need to do is get the sum'd closing balance for a particular account, which in this case is "10090 - Investments".
 
The problem is that this account is part of a few funds, and i want to get the sum of the closing balance for this account across multiple funds.
 
for example...
 
Fund 1  10090 - Investments                      30,000.00
Fund 1   10680 - Cash                                    15,000.00
Fund 2   10170 - Payback                               46,000.00
Fund 2  10090 - Investments                      15,000.00
 
I would just want to see the bold values sum'd, which would be 45,000.00
 
apologies if this makes no sense... please ask for additional information.
 
I tried the following code but this didnt bring out the correct value:
 
iif({Summary_Trial_Balance.Account} = "10090 - Investments", sum({Summary_Trial_Balance.Ending Balance}), 0)
 
Thanks in advanced.
 



Replies:
Posted By: andymc
Date Posted: 26 Mar 2008 at 8:19am
Create a formula (@ balance):
 
if {Summary_Trial_Balance.Account} = "10090 - Investments" then
    {Summary_Trial_Balance.Ending Balance}
 
 
Put this formula in the detail section.  Right-click the formula and insert a summary (sum) on it.
 


-------------
Andymc



Print Page | Close Window