Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: How to Take the Count of a Max... Post Reply Post New Topic
Author Message
kgbo
Newbie
Newbie


Joined: 26 Jun 2013
Online Status: Offline
Posts: 30
Quote kgbo Replybullet Topic: How to Take the Count of a Max...
     Posted: 16 Aug 2013 at 5:53am
Hello,
 
How do you take the count of a max if the value you are returning:
  1. =Yes
  2. =No

I would need two seperate formulas.  I have tried the shared variable formulas but it is counting the data that I am supressing. For example, the chart screened will have three lines as will the trial available, but the max will only display the overall "Yes", thus this would count as one record. How do I get the correct count?

Thank you.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 16 Aug 2013 at 6:37am
One way
Group on the field you want to count
insert a summary of the Y/N Field at the group level
Create a Running Total
field to summarize = teh grouped on field
type = distinct count
evaluate = use a formula
max(Ynfield,group)="yes"
reset=never
place in report footer
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 16 Aug 2013 at 6:39am
hi

When you are counting 'Yes' you need to consider your suppress condition also. ie. based on your suppress condition you have to count your 'Yes'

Example : your suppress conditon is some thing like :

If value > 5000 then true else false

YOur count conditon should be like :

if value < 5000 then count else 0

--if this is not going to solve your problem, post your query in detailed with a data example.
Thanks,
Sastry
IP IP Logged
kgbo
Newbie
Newbie


Joined: 26 Jun 2013
Online Status: Offline
Posts: 30
Quote kgbo Replybullet Posted: 16 Aug 2013 at 8:02am
I have it grouped first by Date of service, then by patient name.
Group one is supressed as is the header for group 2.  The information is placed into the footer of group two.  It would appear as follows:
 
Name                Date                 Compliant
Jane Smith      8/16/2013            Yes
John Doe        8/15/2013             No
 
The compliant column is taking a max. I want to be able to take the count of how many "Yes" values.
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 16 Aug 2013 at 8:10am
create a formual to concantenate the name and date field.
name + totext(date,"mm/dd/yyyy")
use a running total as i described but make the field to sumamrize a distinct count of the above formula field
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