CMCITD
asked on
Summary Crystal Reports--at the Group Level--counting if any records satisfy the criteria from the details section.
Summary Crystal Reports--at the Group Level--counting if any records satisfy the criteria from the details section.
In the details section, there is a field that is either "Y" or "N". I've added a formula at the group level that states:
This appears to be working correctly when I run the report (see attached photo labeled E1).
I then added a formula to the Report Footer section that is a SUM of my group count (the 1s and 0s as noted above). See attached photo labeled E2.
The problem is--when that sum displays, it is showing a sum as though my formula is placed in the detail section instead of the group section. So while I might have 145 unique patients that satisfy that question (i confirmed that number), it's displaying 348 (the total number of visits). I'm not quite sure why due to me placing the original 'IF THIS THEN 1' formula in the group header section.
I'm open to a more elegant way of doing this--however when I attempted running totals, I ran into the same issue. Crystal Reports 2013.
Thanks!
E1.png
E2.png
In the details section, there is a field that is either "Y" or "N". I've added a formula at the group level that states:
IF {FM_Influenza_Reporting.immunization_done} = "Y"
THEN 1
ELSE 0
This appears to be working correctly when I run the report (see attached photo labeled E1).
I then added a formula to the Report Footer section that is a SUM of my group count (the 1s and 0s as noted above). See attached photo labeled E2.
The problem is--when that sum displays, it is showing a sum as though my formula is placed in the detail section instead of the group section. So while I might have 145 unique patients that satisfy that question (i confirmed that number), it's displaying 348 (the total number of visits). I'm not quite sure why due to me placing the original 'IF THIS THEN 1' formula in the group header section.
I'm open to a more elegant way of doing this--however when I attempted running totals, I ran into the same issue. Crystal Reports 2013.
Thanks!
E1.png
E2.png
ASKER
I just care about unique patients that did or did not have an immunization during the time period. However, I do want to see how many encounters they had during the time period--and which provider saw them at that time (For example, a patient may have 3 encounters, with 3 different physicians. I'd want to see 1) Did they get a flu shot this year? and 2) How many times and what doctors missed that opportunity?)
That's why I have the detail section at all. If I put the formula in the detail section however, it wouldn't give me a count of unique patients we missed--but instead a total number of encounters we missed (That's actually what it's doing now). I want the unique patients missed (the group is based on person_id which is unique patients)
That's why I have the detail section at all. If I put the formula in the detail section however, it wouldn't give me a count of unique patients we missed--but instead a total number of encounters we missed (That's actually what it's doing now). I want the unique patients missed (the group is based on person_id which is unique patients)
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That nailed it--I swear I tried that running total before but was getting the same result. I wonder if I put it in the wrong section. THanks again!
Is there a specific reason to count the Y or N at group section and display the total at report footer level when you can directly put a sum on the formula included in the detail section?
I guess you are doing that because your summary report is at group level, but can you explain further if it's a specific requirement?