Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Formula to sum on Period (1 -12) Post Reply Post New Topic
Author Message
colkas
Newbie
Newbie


Joined: 20 Dec 2009
Location: United Kingdom
Online Status: Offline
Posts: 5
Quote colkas Replybullet Topic: Formula to sum on Period (1 -12)
     Posted: 20 Dec 2009 at 7:24am
I am trying to create a formula to sum a field where another field is Period 1.  Basically I have two fields  Invoice Amounts  and Periods (1 to 12).
I want to sum all Invoice Amounts but thave them in sepreated periods, so I ahve totals for 1 to 12 periods.  
 
From there I intend to put actual budget against Invoiced and then take the 2 away from each other.
 
How do I create the formula, I have tried several syntax but with no luck.
Also is there a way to add 12 fields that can be used to store this years budget amounts (no databse field avaialble presently), I tried a text box but this did not work.
Thanks
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 Dec 2009 at 7:41pm
You can group on the period field and doa  SUM at the group level
you can create 12 formula fields and sum each of those
       If table.period=1 then table.amount else 0
       If table.period=2 then table.amount else 0
If this is grouped or sorted by period field you can create a RT SUming the amount
If is is not in order you can create 12 RTs
IP IP Logged
colkas
Newbie
Newbie


Joined: 20 Dec 2009
Location: United Kingdom
Online Status: Offline
Posts: 5
Quote colkas Replybullet Posted: 22 Dec 2009 at 4:41am
I have done the grouping and summary .
 
I tried the code you described but it does not work
 
My field namse are;   Group Name: Table1.period (string)
Details : table1.preriod (string), Table1.actual amount (number)
Group F 1  : Sum of table1.actual amount
Report F :  Sum of table1.actual amount
 
I also dont understand what you mean by RT.  Could you give me a more detailed example.
 
Thanks
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 22 Dec 2009 at 7:14am
Sorry, an RT is a Running Total. You should not need it for this. Just change your GF1 formula to use the grouping...
 
My field namse are;   Group Name: Table1.period (string)
Details : table1.preriod (string), Table1.actual amount (number)
Group F 1  : Sum(Table1.actual amount ,Table1.period )
Report F :  Sum of table1.actual amount


Edited by DBlank - 22 Dec 2009 at 7:22am
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