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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula for counting "Yes" in a column

Status
Not open for further replies.

JonathanNYC

IS-IT--Management
Mar 29, 2003
111
US
As a workaround to duplicate detail lines of data in a report, I grouped by a field called “case number” (a number unique to each case) and then grouped by “case number”. I then copied and pasted fields from the detail row into the group header row and that seems to work fine.

I am able to do a distinct count on case number, but can’t yet get the count I am looking for in a column that has “Yes” in the field.

Here is the formula I am using:

if {pcmTimeOut.correctPatient} = "YES" then
1
else
0

Thus far, my count seems to be including all the “Yes” entries from the detail rows. As such, the count of “Yes” is more than my distinct count of case numbers. I want my count of “Yes” to be the same or lower than my distinct count of case numbers. Right now my count of “Yes” is yielding a higher number than distinct count of case number.

I desire either the count of “Yes” in the Group Header row or to do the count another way so as to avoid the duplicative rows (and duplicative “Yes”) that sometimes exist on multiple rows for one case. I am not sure if it makes a difference or not, but I have to do a count on a few other fields (with “Yes” in them) such as correct patient, correct site and correct side.

I am using Crystal Reports 10 and a surgical database called PS Solutions.
 
Use a running total field, evaluate once per group, reset never.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If you have a big enough dictionary, just about everything is a word"
--Dave Barry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top