Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Summarizing formula Field Post Reply Post New Topic
Author Message
bvineet
Newbie
Newbie


Joined: 07 Mar 2011
Online Status: Offline
Posts: 7
Quote bvineet Replybullet Topic: Summarizing formula Field
     Posted: 07 Mar 2011 at 9:41pm
Please find the formula below:-
 
formula field name = Amount
 
 
Global NumberVar u;
Global NumberVar w;

if ({@Months Remaining}) > 12 then
0
Else If({@Straight Line}) > ({[v2QRY]triContract__triRealEstateContract__cstRealEstateContract___Crystal_Query___Humana_Straight_Line_Lease_Reconciliation.triPayment__triPaymentSchedule____triAmountNU}) and ({@Months Remaining}) = 0 then
u:=(({@Monthly Straight Line Adjustment}) * (-{@Date Difference}))
Else If ({@Months in Between Start Date and Current Date}) < 12 then
w:={@Monthly Straight Line Adjustment} * ({@Difference});

Sum({Amount})
 
If I used this formula it displays an error this field cannot be summarized. I want this field to be in group header
 
 
 
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 08 Mar 2011 at 2:40am
Usually the problem occurs because one of the formulas you are using is already a summary field. How crystal handles summaries do not allow you to summarize summaries.

In this case you must figure out which field cannot be summarized and find an alternate method to implement it (ie: variables)
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 08 Mar 2011 at 3:15am
As Keikoku mentioned, you cannot summarize a formula, at least not if there are calculations and assignments. 
 
In addition, you mentioned that you wanted to place this in a group header. That would only look at the first record of each group, as that is the only time that the formula would be invoked.
 
HTH
 
If there was no assignment to variables, you could probably summarize it, as all of the values are 'known' when Crystal is making its passes through the data
IP IP Logged
bvineet
Newbie
Newbie


Joined: 07 Mar 2011
Online Status: Offline
Posts: 7
Quote bvineet Replybullet Posted: 28 Mar 2011 at 5:05am
Thanks
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