Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: How to add Summary of a field in Report footer? Post Reply Post New Topic
Author Message
GowthamSen
Groupie
Groupie


Joined: 03 Jun 2009
Location: India
Online Status: Offline
Posts: 65
Quote GowthamSen Replybullet Topic: How to add Summary of a field in Report footer?
    Posted: 14 Jul 2009 at 10:39am
Hi,
 
I am trying to add a Summary of a field.
 
The scenario is like this.
 
I have two fields "Employee", "Score". Which can contain negative values and Positive values.  Each employee can have multiple scores. I need to show Maximum of Score in detail section for each employee.
 
So, I inserted a object with Summary option as Maximum.
 
This is working as expected.
 
And in the report filter, I need to display Sum (Max of Score for each employee ).
 
But its summing all the values. Is there any way we can solve this?
 
 
Thank you,
Regards,
 
Gowtham Sen.
Thank you
Regards,

Gowtham Sen.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4366
Quote lockwelle Replybullet Posted: 14 Jul 2009 at 11:08am
little confused on the report filter, but I believe that what you are saying is that sum is summing all scores, not just the max for each employee.  You can do this with shared variables, and probably running totals, but I am not real good with RTs, that is DBlank's forte.
 
For shared variables, you would build a formula that will 'replace' the aggregate for Max.
The formula would look like;
 
local numbervar thisTotal:=MAXIMUM({table.Score}, EmployeeGroup);
shared numbervar MaxTotal:=MaxTotal + thisTotal;
thisTotal
 
Where you want the sum of maxes, build another formula:
shared numbervar MaxTotal
 
HTH
 
IP IP Logged
GowthamSen
Groupie
Groupie


Joined: 03 Jun 2009
Location: India
Online Status: Offline
Posts: 65
Quote GowthamSen Replybullet Posted: 14 Jul 2009 at 11:20am
Hi LockWelle,
 
Here I would like to summ only the max scores only.
 
I have 2 cross tabs.
One is in Report Header and Another one is in Report Footer.
 
In Report Header, I am displaying all employees with maximu scores.
 
In Report Footer, I need to display only sum of Maximum score of each employee.
 
For example:
 
EmpNo ---- Score
----------------------
101   ----  5
101   ---- -4
101   ----  6
102   ----  1
102   ---- -4
102   ----  0
 
So in Report header I should display
EmpNo ---- Score
----------------------
101   ----  6
102   ----  1
 
And in report footer, I should display,
 
Score
-------
7
 
Thank you,
Regards,
 
Gowtham Sen.
Thank you
Regards,

Gowtham Sen.
IP IP Logged
GowthamSen
Groupie
Groupie


Joined: 03 Jun 2009
Location: India
Online Status: Offline
Posts: 65
Quote GowthamSen Replybullet Posted: 14 Jul 2009 at 12:40pm
Hi Lockwelle,
 
I tried the way you mentioned. But its returning 0.
 
The formula is as follows.
 
formula1:
 
Local numbervar ThisTotal:=Maximum ({Query1.Score}, {Query1.Employee});
Shared numbervar MaxTotal:=MaxTotal+ThisTotal;
ThisTotal
 
Formula2:
 
Created another formula as follows.
Shared numbervar MaxTotal
 
I used the "Formula2" in crosstab summary field.
 
Its returning 0. Am I missing any thing.
 
Thanks a lot!
 
Thank you
Regards,

Gowtham Sen.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4366
Quote lockwelle Replybullet Posted: 14 Jul 2009 at 1:45pm
Since you are using crosstabs, I can't guarantee that things will work, as I don't use crosstabs.
 
where are you applying formula1?  Is formula displaying the correct value? if not, nothing is going to work from there on out.  try just getting the max to work correctly.  It should work in a section header...is it in the Employee group header?
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.