Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Trouble doing math on summarized group fields Post Reply Post New Topic
Author Message
bspencer1
Newbie
Newbie


Joined: 26 Nov 2013
Online Status: Offline
Posts: 26
Quote bspencer1 Replybullet Topic: Trouble doing math on summarized group fields
    Posted: 18 May 2015 at 8:41am
Hello, Crystal form members:
Something I thought would be simple is turning out to be hard for me.  I need to calculate the difference between group summaries.  The simplest way to describe would be to say, that in the image below, I need to take the $4,364.60 and subtract it from the $4,353.82 for each Sales Order Confirmation (GH3) and display that in GF3 (for each Sales Order).  GH3 is the sales order confirmations and GH4 is the sales order date. 
 
I thought I could create some global numbervars and make it work.  You can see these variables calculate correctly when placed in GH4, but when I try to create a new formula that calculates the difference in GH3, it is evaluating incorrectly ({@CurrentTotal} - {@PreviousTotal}).  I also have a reset in GH3.  What am I doing wrong, and is there some better way to handle this?
 
 
IP IP Logged
Erik
Groupie
Groupie
Avatar

Joined: 05 Dec 2013
Online Status: Offline
Posts: 50
Quote Erik Replybullet Posted: 19 May 2015 at 6:05am
Try a formula using something like this in your GF3, where {@GroupedBy} is whatever value you are Grouping.

sum({@CurrentTotal}, {@GroupedBy}) - sum({PreviousTotal}, {@GroupedBy})

IP IP Logged
bspencer1
Newbie
Newbie


Joined: 26 Nov 2013
Online Status: Offline
Posts: 26
Quote bspencer1 Replybullet Posted: 19 May 2015 at 8:16am
thanks for the response.  This will not work because the @currentotal and @previoustotal formulas cannot be summarized (I did try it).
IP IP Logged
Erik
Groupie
Groupie
Avatar

Joined: 05 Dec 2013
Online Status: Offline
Posts: 50
Quote Erik Replybullet Posted: 19 May 2015 at 9:12am
I'm not able to find the screenshot you referenced in the first post. That might help give some clarity on how to solve this.
IP IP Logged
bspencer1
Newbie
Newbie


Joined: 26 Nov 2013
Online Status: Offline
Posts: 26
Quote bspencer1 Replybullet Posted: 19 May 2015 at 9:30am
interesting.  it is a public hosting site I put the image...paste this into a browser:
 
IP IP Logged
bspencer1
Newbie
Newbie


Joined: 26 Nov 2013
Online Status: Offline
Posts: 26
Quote bspencer1 Replybullet Posted: 19 May 2015 at 9:45am
I was just able to get it to work by making some improvements to my global variables. 
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.031 seconds.