Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Summary of counts Post Reply Post New Topic
Author Message
josh2009
Newbie
Newbie


Joined: 26 Jun 2009
Location: United States
Online Status: Offline
Posts: 16
Quote josh2009 Replybullet Topic: Summary of counts
     Posted: 30 Jun 2009 at 6:45am
I'm using Crystal Report V8 and was wondering if it is possible to aggregate certain columns in the report. I have ID, lastname, firstname, date, procedure, Attending MD in my report. At the bottom of the report, would it be possible for me to say get the number of times a particular doctor did a procedure in a given date range? Like a summary of counts of procedures for every doctor. Any help would be greatly appreciated. Thanks in advance.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 30 Jun 2009 at 6:55am
The generic answer is yes. the difficult question is how?  depends on how variable everything is, mostly on the number of items to be tracked, how you want it presented.
 
you can do formulas to keep running totals, you might be able to do running totals, DBlank is the expert there, or maybe a subreport would do. some of the aggregates might work as well, or in conjunction with the above methods.
 
all depends on what exactly you are looking for.
 
HTH
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Jun 2009 at 6:56am
You can do this either by grouping your data to support these counts naturally at each group footer level
or
do this in a crosstab
or
you can use Running Totals or variables to do this
or a combination of the grouping and RT/variables.
RTs and variables are very similar and you can do conditional inclusion of rows for to count or SUM.
 
Since you want to show each doctor and an inclusion of their info in the report footer I would use a crosstab.
You will need to create a formula that determines if a row is to be counted or not and then use that to SUM on. The formula would probably be something like:
if table.datefield in begindate to enddate and table.procedure=procedure type then 1 else 0.
 


Edited by DBlank - 30 Jun 2009 at 6:58am
IP IP Logged
josh2009
Newbie
Newbie


Joined: 26 Jun 2009
Location: United States
Online Status: Offline
Posts: 16
Quote josh2009 Replybullet Posted: 30 Jun 2009 at 7:09am
Thank you very much for the quick reply. Really appreciate it. Hopefully I can figure out the crosstab report for this. I'll let you know what happens either way. Again, thanks for the help.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Jun 2009 at 7:13am
Get your formula down.
Set the crosstab as No columns , Row as DR NAME Field and Summarized Field as your new formula field set as a SUM.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Jun 2009 at 7:19am
If you select statement is filtering the data down to only records that meet the conditions you indicated (date range and procedure type) then no formula field is needed. You can set the field to summarize as a COUNT of the pateint ID (for # of appointmentsper doc) or DISTINCTCOUNT of patientID (for # of patients seen by doc).
IP IP Logged
josh2009
Newbie
Newbie


Joined: 26 Jun 2009
Location: United States
Online Status: Offline
Posts: 16
Quote josh2009 Replybullet Posted: 30 Jun 2009 at 8:42am
Excellent tips! I got the crosstab report to work for me exactly the way I want my information to display on the report and my end-user loved it. thanks a bunch for all the tips. Very much appreciated.
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