Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Calculating an average with Duplicates Post Reply Post New Topic
Author Message
halekat
Newbie
Newbie
Avatar

Joined: 10 Nov 2008
Location: United States
Online Status: Offline
Posts: 3
Quote halekat Replybullet Topic: Calculating an average with Duplicates
    Posted: 10 Nov 2008 at 2:02pm

I am creating a turn around time report for EKGs in the Emergency Department.  I am needing the first EKG only. I need to calculate and average the times for the this first EKG for a person who has chest pain.  I have grouped the patients by Account # and sorted by the 3 times.  I have supressed the duplicates in various different ways but the average turn around time that I need is including the times that I suppressed.  Is there a way to calculate the average without the suppressed times?

Adm Time       Acount#     Name                  Order Time    Order Completed
11/10 07:45   309456     Doe, John             07:50            07:55
11/10 07:55   309459     Smith, Anita          08:00            08:10
11/10 07:55   309459     Smith, Anita          08:20            08:30
11/10 07:57   309510     Johnson, Jimmy     08:30            08:30
Thanks
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 11 Nov 2008 at 6:30am
Here is an idea...hopefully it is useful.
 
I sounds like there is a group for account and for time(to sort by).  Everytime your account changes, set a shared flag/variable of some sort.  At the first record, get the time that you need and add it to a shared variable and set the flag.  Next record checks the flag and is not added.
 
Now you have a big time number, at the end, when you need to report on it, take your big time number and divide it by the distinct count of accounts and you should have the average.
 
Hope this useful or at least gives you an idea to get to the solution.
IP IP Logged
halekat
Newbie
Newbie
Avatar

Joined: 10 Nov 2008
Location: United States
Online Status: Offline
Posts: 3
Quote halekat Replybullet Posted: 17 Nov 2008 at 1:03pm
Yes, it was very useful.
Thanks
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.016 seconds.