Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Formula math not correct? Post Reply Post New Topic
Author Message
glindsay
Newbie
Newbie
Avatar

Joined: 19 Nov 2009
Online Status: Offline
Posts: 3
Quote glindsay Replybullet Topic: Formula math not correct?
     Posted: 19 Nov 2009 at 8:39am

I have a formula that subtracts one formula from another formula on the group footer. One is a summed total the other is a field multiplied by a number. If the summed total formula has only one record in it, it is correct, if more then one record it’s not correct.

 

            C1        C2        C3

 

Ying      75

GF1      75        300     -225    (75-300=-225)

 

Yang    224

            224

            224

            224

            224

GF1      1120   896     -672    (1120-896=224)

 

C1 formula is, @TrandAmount, which is {U4TRND.TDAMT} * -1          

C2 formula is, @Required Payments, which is {U4CSTMR.CSBGPY} * 4

C3 formula is, @DIFF, which is {@TrandAmount} - {@Required Payments}

 

This is my first post here so I hope I’ve included all the info that’s required to help solve this problem I’m having.

 
Thanks
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Nov 2009 at 9:34am
Which formula is a SUM as I do not see that function being used at all?
IP IP Logged
glindsay
Newbie
Newbie
Avatar

Joined: 19 Nov 2009
Online Status: Offline
Posts: 3
Quote glindsay Replybullet Posted: 19 Nov 2009 at 9:52am

Well that would be C1 column. I used the insert summary button from the tool bar and inserted it into GF1 at C1 column.

 

Yang    224

            224

            224

            224

            224

GF1     1120    ß Summed total from above 5 detail records.

 
BTW @TrandAmount is a forumla because I need to reverse the sign of the number from neg. to pos.


Edited by glindsay - 19 Nov 2009 at 9:55am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Nov 2009 at 10:10am
if the required payments field does not change at all on each row per group then try the below for @DIFF ...
SUM({@TrandAmount},group1field) - {@Required Payments}
IP IP Logged
glindsay
Newbie
Newbie
Avatar

Joined: 19 Nov 2009
Online Status: Offline
Posts: 3
Quote glindsay Replybullet Posted: 19 Nov 2009 at 12:16pm
Thanks so much DBlank, that done the trick. Clap
 
I wonder if I'll ever get the hang of writing formulas  Smile
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