Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Counting records problem Post Reply Post New Topic
Author Message
elamantia
Newbie
Newbie
Avatar

Joined: 20 Aug 2008
Online Status: Offline
Posts: 24
Quote elamantia Replybullet Topic: Counting records problem
     Posted: 27 Jul 2015 at 9:46am
I have individuals who are on probation. Each individual can have multiple records, each record shows their offense level (Felony or Misdemeanor). Some have multiple felonies, some have felonies and misdemeanors, some just misdemeanors. I need a count of those that have felonies regardless if they also have misdemeanors, and I need a count of those that have JUST misdemeanors. The felony count is easy because I don't care if they also have misdemeanor charges. How do I get the misdemeanor count?

The individual would count just once regardless of how many felonies or misdemeanors they have. I have been stumped on this for weeks!!!
minnie_eye
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Jul 2015 at 11:26am
maybe this?
grouping on the personid
create a flag formula to identify felony records
//@flag
if field='felony' then 1
sum this at the personid group
any group with a sum>0 is a person with at least one felony
create a Running Total
Name = no Felony count (or whatever)
field to summarize=personid
type=distinct count
evaluate = use a formula
sum(@flag,personid)=0
reset=never
place in report footer

Edited by DBlank - 27 Jul 2015 at 11:28am
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