Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: How to sum a sum? Post Reply Post New Topic
Author Message
huraczech
Newbie
Newbie
Avatar

Joined: 05 Aug 2009
Online Status: Offline
Posts: 1
Quote huraczech Replybullet Topic: How to sum a sum?
    Posted: 05 Aug 2009 at 7:09am
Hello, I hope you can help me. I created a formula containing a field from a DB and a formula "Sum ({@CurPremSumEr}) + {PremiumAdjustment.Prem_Adj_Er}" and now I need to make total SUM of those fields in the reports. The formula @CurPremSumEr is defined like this "Sum ({RenewalTransactions.Prem_Period_Er}) + {PremiumAdjustment.Prem_Adj_Er}". How can I do this? I tried to create other SUM but it doesn't work as SUM (@CurPremSumEr). 
Thanks a lot!!!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 Aug 2009 at 7:30am
You cannot use a summarized field to do any calculations from.
Generally you can create a RT that conditionally counts/sums records at the larger or report fooer level grouping and use that instead.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 05 Aug 2009 at 1:30pm
I usually create a shared variable, you can create the sum, that is already being displayed, add it to a variable, and then display the original value in a formula.... somethin like
 
shared numbervar bigSum;
local number littleSum := sum({table.field}, {group});
bigSum := bigSum + littleSum;
littleSum
 
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.014 seconds.