Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: COUNTING USING MULTIPLE CRITERIA Post Reply Post New Topic
Author Message
K296
Newbie
Newbie
Avatar

Joined: 04 Mar 2013
Location: United States
Online Status: Offline
Posts: 2
Quote K296 Replybullet Topic: COUNTING USING MULTIPLE CRITERIA
     Posted: 05 Mar 2013 at 2:19am

I am trying to count using a set of multiple criteria and would appreciate any help available. I work at a county jail and have a report showing who has come to jail on what charges by date. The booking_id is unique to a person, but can be used multiple times for each arrest by date. For example John Doe, booking id 123, may have come to jail 3 times this year. If I distinctcount booking id's then it would only count John Doe one time.

Does anyone know how I would count the record if it is a unique combination of date arrested and booking id? In excel, I could use sumproduct, but that function doesn't exist in the crystal reports environment.
K296
IP IP Logged
K296
Newbie
Newbie
Avatar

Joined: 04 Mar 2013
Location: United States
Online Status: Offline
Posts: 2
Quote K296 Replybullet Posted: 05 Mar 2013 at 3:08am
A solution has been found, so I thought that I would share it just in case anyone else is trying to figure out the same thing.
 
Create a formula which concatenate date and ID togther and then do a unique count on that

@NewId
totext(ID, 0,"")+totext(date, 'yyyyMMdd')

or use a Running total which evaluates on change of date and resets on change of ID

Ian
K296
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