Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Count if highlighted or other criteria Post Reply Post New Topic
Author Message
Andrewarbogast
Newbie
Newbie
Avatar

Joined: 21 Aug 2017
Location: United States
Online Status: Offline
Posts: 39
Quote Andrewarbogast Replybullet Topic: Count if highlighted or other criteria
    Posted: 19 Sep 2017 at 3:44am
So I'm trying to get counts of specific criteria and the totals are not working.
The criteria are:

count {field} if it says MHA Missing
count {field} if it's highlighted yellow
count {field} if it's >=2.999

any ideas?
Thanks
IP IP Logged
Andrewarbogast
Newbie
Newbie
Avatar

Joined: 21 Aug 2017
Location: United States
Online Status: Offline
Posts: 39
Quote Andrewarbogast Replybullet Posted: 19 Sep 2017 at 4:14am
So I was able to get some totals based on summing formulas like:

If{@New MHA order}="MHA Missing" Then 1 else 0

if{@datediff 2}>=2.5
and{@datediff 2}<=2.998 then 1 else 0

running total for >=3
evaluate - on change of group
rest - never

I created parameters to select clinicians which range from 1 - 259 clinicians. I tested the totals for 1 clinician and 2 clinicians but when I select all clinicians and export it to excel and compare the totals they don't match except for client count.

Client count = 6522
Missing MHA = 968 (excel 845)
Due Date Approaching = 531 (excel 385)
MHA Update Due = 480 (excel 478)

Please help!
IP IP Logged
Andrewarbogast
Newbie
Newbie
Avatar

Joined: 21 Aug 2017
Location: United States
Online Status: Offline
Posts: 39
Quote Andrewarbogast Replybullet Posted: 19 Sep 2017 at 8:51am
New update:
The totals are counting suppressed data. What I'm confused about is there's no fields in my suppressed sections. When I put the "clinician" field in the details section, I see that there are multiple clinicians attached to the client which I'm guessing is where these totals are being skewed.

Is there a way to ignore suppressed data?
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 19 Sep 2017 at 10:24am
Just because something suppressed in CR, it is still there.  If you do not want it to count then that same criteria needs to be in your running total (or formula is you are going that route).
IP IP Logged
Andrewarbogast
Newbie
Newbie
Avatar

Joined: 21 Aug 2017
Location: United States
Online Status: Offline
Posts: 39
Quote Andrewarbogast Replybullet Posted: 20 Sep 2017 at 3:03am
So I suppressed my details section by right clicking and suppressing in Design. For my totals, I have two summaries and a running total:
If{@New MHA order}="MHA Missing" Then 1 else 0

if{@datediff 2}>=2.5
and{@datediff 2}<=2.998 then 1 else 0

running total for {@>=3}
evaluate - on change of group (group #1 PATID)
reset - never

Is there a way to ignore suppressed data in these formulas?
Thanks
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 20 Sep 2017 at 3:54am
What is the criteria for not including a value in a running total?  That will have to be included in the formula so that the running total does not happen.
IP IP Logged
Andrewarbogast
Newbie
Newbie
Avatar

Joined: 21 Aug 2017
Location: United States
Online Status: Offline
Posts: 39
Quote Andrewarbogast Replybullet Posted: 20 Sep 2017 at 5:10am
I don't have a criteria. Right now I'm doing formulas like:
if{@datediff 2}>=3 then 1 else 0

and then I do a sum of that in my running total.
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 20 Sep 2017 at 9:03am
Again, just remember that suppressing a field, group, etc. does not remove it from the report, just hides it.

So running totals have to set up so that you are only counting what you want, not what you see.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 21 Sep 2017 at 2:48am
kevlray is absolutely correct, don't confuse data visibility with its existence and the inclusion of it in summary data.
Since you are using Running totals, just use the distinct count on your patient id using your criteria not a "1 or 0" result sum.
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.