Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Total # of rows, % and does not contain Post Reply Post New Topic
Author Message
cr2user
Newbie
Newbie
Avatar

Joined: 06 Oct 2008
Location: United States
Online Status: Offline
Posts: 4
Quote cr2user Replybullet Topic: Total # of rows, % and does not contain
     Posted: 06 Oct 2008 at 8:05pm
I need to create a CR to show total# of patients(all active patients-with or without email address), total# of patients with email address only, % of patients with email address, broken down by Physician and location.  So far, I've created a report to show all patients with email address , however, not all email address are valid. What's the best way to eliminate the invalid email address (any that doesn't contain .com , .net, .edu etc). 
 Also, I can get the total# of patients with email address, but how do I get the total # of patients so that I can get the % - do I need to use a subreport? or a count parameter to hold the value of total # of patients (all active patients-with or without email address). Thanks in advance.
cr2user
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 07 Oct 2008 at 2:15pm
Run you're report for all patient - not just those with an email address.  Then I suggest using a formula to set up your email count.  It will look something like this:
{@ValidEmail}
If InStr(LowerCase({table.email}), '.com') > 0 or
  InStr(LowerCase({table.email}), '.net') > 0 or
  InStr(LowerCase({table.email}), '.edu') > 0 or
  InStr(LowerCase({table.email}), '.gov') > 0 then
  1
else
  0
In your report, you'll do a sum of this formula to get the count of patients with an email address.  To get the percentage, you'll use a formula like this:
sum({@ValidEmail}) % count({<however you're counting patients})
 
To automatically display the '%', format the number, turn on the "Currency Symbol", set the position to be after the number and change the symbol to '%'.
 
-Dell
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