Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Count Attribute "A" and Attribute "B" across records?

Status
Not open for further replies.

jaybar48

Technical User
Feb 16, 2002
61
US
I have a table called Encounters with the following fields:

Client_ID
Service_Cat
Encounter_date

The values for the Service_Cat field are either "PC" (Primary Care) or "cm" (Case Management). There is one record for each encounter. A client can have multiple encounters and most do.

Some clients have only Primary Care encounters (records where service_cat="pc") or only Case Management Encounters ( records where Service_cat="cm"), while some clients have BOTH. I am interested in the clients who have BOTH types during the reporting period. How can they be counted?


Thanks,

Jay

 
Use a date range in your record selection formula. Group on {table.client_ID} and then go to report->edit selection formula->GROUP (Not record) and enter:

distinctcount({table.service_cat},{table.client_ID}) = 2

This will result in a report which includes only those clients with both types of encounters during the selected time period.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top