Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Conditional Counting Post Reply Post New Topic
Author Message
sandy
Groupie
Groupie


Joined: 10 Jan 2007
Location: United States
Online Status: Offline
Posts: 45
Quote sandy Replybullet Topic: Conditional Counting
     Posted: 20 Dec 2010 at 4:26am
I was following this posting by hilfy:  Conditional Running Tally - CR XI
My report has the following sections:
GH1 - Dept
GH2 - Problem  (each dept has a list of problems they resolve)
My goal is to total the # of problems reported in 2009 by problem type (GH2) within each dept(GH1)
 
For ex: 
HR Dept
   Union issues          5  (GF2)
   Personnel issues   3   (GF2)
Total for HR               8   GF1c
 
I need totals by the problem type (GF2) under each dept as well as the total for the dept in GF1c. 
 
I placed the following formula in the detail line called @Count_2009:
if Year({CUSTPROB.PROBDTTM})=(Year({?EndDate})-1) 
then 1 else 0
 
I then placed this formula in GF2 called : @TotalCount2009
sum({@Count_2009}, {CUSTPROB.PROB})
 
Can anyone help me to get the total for each dept which in GF1c?
 
Thanks in advance!

 
 
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 Dec 2010 at 4:45am
Create a new summary at the department level
 
sum({@Count_2009}, {CUSTPROB.DEPT})
IP IP Logged
sandy
Groupie
Groupie


Joined: 10 Jan 2007
Location: United States
Online Status: Offline
Posts: 45
Quote sandy Replybullet Posted: 20 Dec 2010 at 4:50am
Thank you!
One additioonal question I forgot to ask.  When I need the Grand total  of all departments what formula would I use?  The grand total of all departments in in RFa.  Thanks for helping.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 Dec 2010 at 4:53am
a sum with no group level
 
Note that none of these deal with duplicated data so I assume that is not an issue for you...
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