Print Page | Close Window

Sum Formula in Group

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=5911
Printed Date: 16 Apr 2024 at 10:49am


Topic: Sum Formula in Group
Posted By: joshdooley
Subject: Sum Formula in Group
Date Posted: 27 Mar 2009 at 6:38am
I have a formula that is inserting a "1" into the report if a job is a "warranty" job.  This formula is working.  Now, I want the "sum" of those items on the report.  Crystal 2008 is not letting me do it.
 
The name of this formula is "Warranty"  It is working.
if GroupName ({WORK_ORDER.LOT_ID}) = "W" then 1
 
I created a second formula called "Warranty Count."  The formula that I attempted to use to "sum" the "1" totals is
 
if mailto:%7b@Warranty - {@Warranty } = 1 then Sum ( mailto:%7b@Warranty - {@Warranty })
 
Crystal 2008 is giving me an error, "This field cannot be summarized."  I also tried
 
if mailto:%7b@Warranty - {@Warranty } = 1 then Count ( mailto:%7b@Warranty - {@Warranty })
 
Also tried
 
Sum (  mailto:%7b@Warranty - {@Warranty })
 
Same error, "This field cannot be summarized." 
 
Also, I cannot right click and "INSERT SUMMARY" into the report.  Crystal 2008 is not allowing it for this particular scenarios.  
 
 
 Any help is appreciated!



Replies:
Posted By: joshdooley
Date Posted: 03 Apr 2009 at 10:36am
Any ideas on this one guys and gals?


Posted By: Chrissy
Date Posted: 03 Apr 2009 at 2:12pm
What if you try declaring a variable where you assign the 1...
 
 
something like
 
 
shared numberVar x;
 
if GroupName ({WORK_ORDER.LOT_ID}) = "W" 
        x := x + 1;
        1
 
 
Then you would need to add two other formulas, one setting the x variable to zero and putting in the appropriate place on the report.  and then another one with just the value of x to give you the sum.


Posted By: shijobaby
Date Posted: 28 Nov 2009 at 9:57am
http://crystalrepterrinfo.blogspot.com/2009/11/error-on-sum-in-formula-field-crystal.html -
Refer the steps
 
 
http://crystalrepterrinfo.blogspot.com/2009/11/error-on-sum-in-formula-field-crystal.html
 
 



Print Page | Close Window