Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: running total with if Post Reply Post New Topic
Author Message
bhar4
Newbie
Newbie


Joined: 18 Jul 2012
Online Status: Offline
Posts: 11
Quote bhar4 Replybullet Topic: running total with if
     Posted: 18 Jul 2012 at 9:25am

I am trying to create running total of calculated annual salary at the group level.  I am new to Crystal and this is my first attempt with this in a report.  What am I doing wrong?  Below is my code.

WhilePrintingRecords;
CurrencyVar Amount; 
 
if {Command.POS_LEVEL} <> 1
then ' '
else
totext({Command.NBR_FTE} * {Command.POSPAYRATE} * 2080);
 
I can't seem to come up with the right syntax to get a numeric result.
What additional code do I need?


Edited by bhar4 - 18 Jul 2012 at 10:36am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 18 Jul 2012 at 11:27am
not quite sure what your running total portion is but you are returning text in your formula
 
if {Command.POS_LEVEL} <> 1
then 0 else
({Command.NBR_FTE} * {Command.POSPAYRATE} * 2080);
 
 
or you could use
 
{Command.NBR_FTE} * {Command.POSPAYRATE} * ( if {Command.POS_LEVEL} <> 1 then 0 else 2080)
 
IP IP Logged
bhar4
Newbie
Newbie


Joined: 18 Jul 2012
Online Status: Offline
Posts: 11
Quote bhar4 Replybullet Posted: 19 Jul 2012 at 2:23am
I am trying to do a running balance on the calculated amount annual salary.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Jul 2012 at 3:32am
the above formula should give you a numeric result which you can use in a shared variable formula to sum or in a Running Total.
IP IP Logged
bhar4
Newbie
Newbie


Joined: 18 Jul 2012
Online Status: Offline
Posts: 11
Quote bhar4 Replybullet Posted: 19 Jul 2012 at 4:34am
Thanks so much this gave me what I needed.
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