Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Help to Get Summation of Each Group Post Reply Post New Topic
Author Message
aldrean
Newbie
Newbie


Joined: 09 Dec 2010
Online Status: Offline
Posts: 2
Quote aldrean Replybullet Topic: Help to Get Summation of Each Group
    Posted: 09 Dec 2010 at 1:33am


Hi guys, I just want to ask for your help regarding my report.As you can see I am suppose to get the total Market Values for each group(Available For Sale, Held For Trading...).Notice also that the report behaves in such a way that the total Market Value for each Stock(PSB, PNB...) is simply its last value since it is just the runnning balance outstanding shares multiply by the current price.That is correct but as i said i need to get the summation of those totals, so to simplify my concern, I want to get the summation(per Group) of all last values for each Stock.

Hope you understand my problem correctly..Thanks.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 09 Dec 2010 at 3:19am
use a global variable in a formula and increment it only in the group footer (which is the last row of the group).
 
HTH
IP IP Logged
aldrean
Newbie
Newbie


Joined: 09 Dec 2010
Online Status: Offline
Posts: 2
Quote aldrean Replybullet Posted: 09 Dec 2010 at 1:42pm
Thanks lockwelle, really appreciate your help, but can you please guide me in your thought about incrementing the global variable only in the group footer?
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 10 Dec 2010 at 2:48am

global variables are created / reference / incremented in formulas.

Typically the formulas come in groups of 3, reset, increment, display
 
reset, usually in a group header:
global numbervar aTotal := 0;
"" //hides the reset
 
increment, usually in detail, but in a group footer this time:
global numbervar aTotal;
 
//if there was a condition, you would put that here, but if this is straight summing without a condition...
aTotal := aTotal + {table.field};
""  // to hide the running total
 
display, usually in a group footer:
global numbervar aTotal
 
 
that pretty much is a primer on global variables.  That easiest place to make mistakes is that := is the assignment operator while = is the comparator.
 
HTH
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.016 seconds.