Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Field Cannot Be Summarized - Need Help Post Reply Post New Topic
Author Message
benwt85
Newbie
Newbie


Joined: 09 Mar 2011
Online Status: Offline
Posts: 2
Quote benwt85 Replybullet Topic: Field Cannot Be Summarized - Need Help
     Posted: 09 Mar 2011 at 3:51pm

I am currently trying to apply FCA (Full Cost Attribution) to a current Income Statement generated from Crystal. The costs to be shifted are based on a percentage of total wages.

Currently i have 4 rows of data and for this i will call them A,B,C,D
@A-Actual Figures
@B-Costs to Reallocate
@C-Wages
@D-Reallocated Costs
 
Rows A,B,C all work correctly and a i'm able to summarize this rows in my required Groups (3) and the Report Footer, however i can get the correct answer for each detail in D but when i try to Sum in the Groups and Report Footer i am told "Field Cannot be Summarized"
 
The formula for @D is: @D = {@C}*{FCA%}
FCA% is percentage to ReportTotal@B over ReportTotal@C represented as: @FCA% = Sum({@B})/Sum({@C})
 
If anyone has an ideas/suggestions it would be great.
IP IP Logged
yggdrasil
Senior Member
Senior Member
Avatar

Joined: 19 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 150
Quote yggdrasil Replybullet Posted: 10 Mar 2011 at 3:30am
When I need to add up calculated fields, which cannot be summed by Crystal, I do it with formulae like this
On the detail line where @D is I make a formula
 
WhilePrintingRecords;
numbervar sum_D;
sum_D := sum_D + @D
 
If I put that formula in the footer as it is, it will do the sum again, and I will get more than the actual value. So I take the variable on its own in a footer formula
 
WhilePrintingRecords;
numbervar sum_D;
 
If I am summing over a group, I have to zero this for the next group, so I need a formula to go in the group header
 
WhilePrintingRecords;
numbervar sum_D;
sum_D := 0
 
 
I need a separate formula to do the same thing but never reset for the report total.
 
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 10 Mar 2011 at 3:42am
you can't do an aggregate function on an aggregated item...so you can't do sum(sum a/sum b).
 
I like the shared variable method that yggdrasil demonstrates, you might be able to use running totals as well, but I am not well versed in those.
IP IP Logged
benwt85
Newbie
Newbie


Joined: 09 Mar 2011
Online Status: Offline
Posts: 2
Quote benwt85 Replybullet Posted: 10 Mar 2011 at 11:51am

thanks for that. i can get the values to show in the detail however i am having problems with the summing of a group.

After the detail the next group is hidden and when i use the summing formula provided in the second post it is only returning the final value for detail section and not a sum.

IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 11 Mar 2011 at 3:24am
if you try to sum a sum or a calculation that involves a sum, CR won't let you.  The way to get around this and get the values that you want is to do as yggdrasil suggests and to use shared variables to manually create the sum that you are after.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum