Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Sum of a Maximum Post Reply Post New Topic
Author Message
wpshc
Newbie
Newbie


Joined: 06 Aug 2010
Online Status: Offline
Posts: 6
Quote wpshc Replybullet Topic: Sum of a Maximum
     Posted: 18 Jan 2011 at 5:06am
I am looking for some help developing a formula/workaround to calculate the sum of a maximum value in Crystal XI.  I am calculating flu vaccination stats grouped by manager.  If the employee has received the flu vaccination, then 1 else 0.  And since there are multiple records/employee, I have selected the max value.  However, I need a sum of employees who have received the vaccine by manager, and Crystal will not let me do this because I am attempting to calculate the sum using maximum values.  Is there something I can do to get around this?


Ex.
                                                       Max Values
Manager 1
    Employee 1   Vaccination Rec'd   1
    Employee 2                                 0

Manager 2
    Employee 1   Vaccination Rec'd   1
    Employee 2                                 0
    Employee 3   Vaccination Rec'd   1

Total for Manager 1 should be 1 and total for Manager 2 should be 2.


I found the formula below in another forum, but it is calculating a sum for the entire report whereas I need it by manager:

In the group header place this formula:

whileprintingrecords;
currencyvar y := y + Maximum ({PriceField}, {Customer # Field});

In the report footer place this formula:

whileprintingrecords;
currencyvar y;
y

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 18 Jan 2011 at 5:25am
Running Total
Field To summarize=EmployeeID
Type=DistinctCOunt
Evaluate=use a formula ... use the formula you had to get the "1" value...like .... table.Flueshot=True
Reset=on manager group
place in group footer
 


Edited by DBlank - 18 Jan 2011 at 5:25am
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