Print Page | Close Window

summing only visible fields

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Tips and Tricks
Forum Discription: Have you learned some great tricks to share with the group? Post them here!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=18008
Printed Date: 18 Apr 2024 at 5:47pm


Topic: summing only visible fields
Posted By: rsj12
Subject: summing only visible fields
Date Posted: 14 Nov 2012 at 7:31am

How do I sum only the visible fields in a column at the end of the report?

My report has only 1 formula field in the Group Footer 1 section called Est Cost

 @Est Cost
if {unifier__weeklyrpt1.CM_GCAMOUNT_CA} > {unifier__weeklyrpt1.CM_POLBESTIMATE_CA}
        then {unifier__weeklyrpt1.CM_GCAMOUNT_CA}
        else {unifier__weeklyrpt1.CM_POLBESTIMATE_CA}
 
this field is conditionally suppressed by using the following formula in the Common tab 'Suppress' option
 
(not(isnull({unifier__weeklyrpt1.CPCO_Status})) and {unifier__weeklyrpt1.CPCO_Status}="Active")
//added below logic per change request from Shani Howard 8/6/2012
OR
(not(isnull({unifier__weeklyrpt1.CPCO_Status})) and {unifier__weeklyrpt1.CPCO_Status}="Incorporated")
//added below logic per change request from Shani Howard 10/23/2012
OR
(not(isnull({unifier__weeklyrpt1.CPCO_Status})) and {unifier__weeklyrpt1.CPCO_Status}="Pending")
OR
(isnull({unifier__weeklyrpt1.CPCO_Auth}) and
 isnull({unifier__weeklyrpt1.CPCO_No}) and
 isnull({unifier__weeklyrpt1.CPCO_Status}) and
 not(isnull({unifier__weeklyrpt1.CO_Auth_Amt})))
 
I want to only sum the non-suppressed 'Est Cost' fields in the report footer.  Right now it is summing all of the occurrences of the 'Est Cost' field.
Thanks a Lot!


-------------
rsj



Replies:
Posted By: hilfy
Date Posted: 28 Nov 2012 at 4:09am
Create a formula that looks something like this:
 
If
(not(isnull({unifier__weeklyrpt1.CPCO_Status})) and {unifier__weeklyrpt1.CPCO_Status}="Active")
//added below logic per change request from Shani Howard 8/6/2012
OR
(not(isnull({unifier__weeklyrpt1.CPCO_Status})) and {unifier__weeklyrpt1.CPCO_Status}="Incorporated")
//added below logic per change request from Shani Howard 10/23/2012
OR
(not(isnull({unifier__weeklyrpt1.CPCO_Status})) and {unifier__weeklyrpt1.CPCO_Status}="Pending")
OR
(isnull({unifier__weeklyrpt1.CPCO_Auth}) and
isnull({unifier__weeklyrpt1.CPCO_No}) and
isnull({unifier__weeklyrpt1.CPCO_Status}) and
not(isnull({unifier__weeklyrpt1.CO_Auth_Amt}))) then 0
else {@Est Cost}
 
Then sum this formula, which will only have a value if the field is not being suppressed.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window