Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Formula not summing correctly Post Reply Post New Topic
Author Message
dawnh44
Groupie
Groupie


Joined: 25 Sep 2011
Online Status: Offline
Posts: 79
Quote dawnh44 Replybullet Topic: Formula not summing correctly
     Posted: 18 Jan 2012 at 4:40am
Hello everyone,
 
I have a formula named ee_save.  In this formula I have the following:
 
ccur({S_SRV_REQ.SR_OS})
 
This gives the amount the the employee is saving.  I tried creating a sum formula for this, but it is not coming out correctly.  Does anyone have any ideas?
 
Thank you.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 18 Jan 2012 at 4:52am
do you have duplicate rows in your data set?
IP IP Logged
dawnh44
Groupie
Groupie


Joined: 25 Sep 2011
Online Status: Offline
Posts: 79
Quote dawnh44 Replybullet Posted: 18 Jan 2012 at 5:02am
Hello,
 
No.  I don't.  I've tried using the following formula:
 
sum(ccur({S_SRV_REQ.SR_OS}))
 
I receive an error message stating, "A field is required here." 
 
Thank you.
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 18 Jan 2012 at 5:15am
try
ccur(sum({S_SRV_REQ.SR_OS}))
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 18 Jan 2012 at 5:20am

I am assuming your original post ..." I tried creating a sum formula for this, but it is not coming out correctly. " .... indicated a wrong total value.

If kostya's solution does not work for you what did you mean exactly by "not coming out correctly"?
IP IP Logged
dawnh44
Groupie
Groupie


Joined: 25 Sep 2011
Online Status: Offline
Posts: 79
Quote dawnh44 Replybullet Posted: 18 Jan 2012 at 7:58am
Hello,
 
I've tried kostya's solution, and I have a message that it's expecting a field.
 
Currently the fiels S_SRV_REQ.SR_OS is a string.  It's being converted to currency using the ccur function.  This formula utilizing this is called ee_save.  The ee_save formula has ccur({S_SRV_REQ.SR_OS}).  This is pulled into my report in Group Header 2. 
 
My goal is to take ee_save and total it at the end of my report.  Any ideas?
 
Thank you.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 18 Jan 2012 at 8:09am
first i would double check to make sure all of your strings can be converted
in the select expert try:
NOT(isnumeric({S_SRV_REQ.SR_OS}))
if any rows come back look at them and decied how you need to fix these.
 
next you need to sum at a group level
place in your group header 2
 
sum({@ee_save})
would be palced in the report footer or header for the entire amount
 


Edited by DBlank - 18 Jan 2012 at 8:10am
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 18 Jan 2012 at 8:26am
apparently you cant
write a convert and sum function in the same formula
IP IP Logged
dawnh44
Groupie
Groupie


Joined: 25 Sep 2011
Online Status: Offline
Posts: 79
Quote dawnh44 Replybullet Posted: 18 Jan 2012 at 10:31am
You are a genius!!!!!  THANK YOU!!!!!!!!!!!  Thumbs%20Up
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