Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: count of group footer count in report footer Post Reply Post New Topic
Author Message
jbalbo
Senior Member
Senior Member
Avatar

Joined: 17 Feb 2011
Online Status: Offline
Posts: 219
Quote jbalbo Replybullet Topic: count of group footer count in report footer
     Posted: 04 Dec 2012 at 8:37am
Hi I have a distinctcount(field) in a group footer...
The value can equal 1,2,3 or 4
It is grouped on name..
On the report footer I want to put how many names have 1, 2 3, or 4
for example

name1 (group footer) Jim  2
         2                        joe  1
         3                        bob  1

                        etc   ...

Report Footer to say No. of 1's :2
                                  No of 2's: 1
                                  No. of 3's  etc

Thanks in Advance

Joe

IP IP Logged
comatt1
Senior Member
Senior Member
Avatar

Joined: 19 May 2011
Online Status: Offline
Posts: 337
Quote comatt1 Replybullet Posted: 04 Dec 2012 at 8:46am
create 4 running totals
sum on the group field
evaluate if = 1,2,3,4 (4 RTs)
reset never

I think this will work.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Dec 2012 at 8:53am
I think you will have to tweak this
 
you will need 4 RTs each with a different evlauate formula
 
name=1s
field to summarize=name
type of summary=distinctcount
distinctcount(field,group) = 1
reset=never
 
repeat for each count but change the = part of the evaluate formula
evaluate=use a formula
 
IP IP Logged
jbalbo
Senior Member
Senior Member
Avatar

Joined: 17 Feb 2011
Online Status: Offline
Posts: 219
Quote jbalbo Replybullet Posted: 04 Dec 2012 at 8:59am
I think I solved this but would like opinons if its the correct way...
3 formulas for each catergory 1,2,3 and for

so  for count of ones:
formula1 in Report Header :
 WhilePrintingRecords;
NumberVar oneTotal :=0;

Formula2 in group footer:
WhilePrintingRecords;
if DistinctCount ({field}, {@Groupname}) = 1
then
NumberVar onesTotal := onesTotal + 1

Formula3 in report footer:
WhilePrintingRecords;
NumberVar onesTotal;
onesTotal;;
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Dec 2012 at 9:05am
if you place it on a gfooter i think that would work.
It is basically the same thing as the RT except I recommended using a distinctcount. Just wathc for it double counting if you palce it anywhere but the gfooter.
YOu will also likely need a final display fomrual so it does not double count from the gf to the rf
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