Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Unique Counts Post Reply Post New Topic
Author Message
npatel
Newbie
Newbie


Joined: 16 Dec 2010
Location: United States
Online Status: Offline
Posts: 20
Quote npatel Replybullet Topic: Unique Counts
    Posted: 16 Dec 2010 at 7:46am
I'm new to crystal reports and I was trying to create a unique count. For example the records pull look like this:

Date                           ID            Result
12/16/2010 11:15:48   123456     X
12/16/2010 13:24:32   123456     X
12/16/2010 15:17:18   354886     X
12/16/2010 18:48:55   123456     X

And I want to count the result when it equals X, but only the most recent result. So ideally I want the count for this data set to display "2" 1 for each ID. Is there a way to do this?

Thanks in advance

Edited by npatel - 16 Dec 2010 at 7:49am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 16 Dec 2010 at 8:16am
do you mean you want a distinct count of ID when the REsult value = "X"?
IP IP Logged
npatel
Newbie
Newbie


Joined: 16 Dec 2010
Location: United States
Online Status: Offline
Posts: 20
Quote npatel Replybullet Posted: 16 Dec 2010 at 8:24am
Actually the the distinct count of ID when the result value = "X" if it's the most recent instance. So if the result is "Y" for a later Date, then "X" is not counted and "Y" is used instead.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 16 Dec 2010 at 8:37am
Not following you...
Most recent instance as defined by what? ...The maximum Datetime per ID?.
If that is the case then what is X and what is Y?
IP IP Logged
npatel
Newbie
Newbie


Joined: 16 Dec 2010
Location: United States
Online Status: Offline
Posts: 20
Quote npatel Replybullet Posted: 16 Dec 2010 at 8:47am
Yes the most recent instance defined by the maximum datetime per ID. X and Y are statuses that could vary from 12 different static entries or preset list of possibilities.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 16 Dec 2010 at 9:02am
still not exactly sure how your using the status value but the basic idea is a running total
group on ID
create a RT as
value to sumamrize = ID
Type = DistictCount
Evaluate=use a formula
MAXIMUM(date,ID) = date and status = "whatever"
reset= Never
place in report footer


Edited by DBlank - 16 Dec 2010 at 9:02am
IP IP Logged
npatel
Newbie
Newbie


Joined: 16 Dec 2010
Location: United States
Online Status: Offline
Posts: 20
Quote npatel Replybullet Posted: 16 Dec 2010 at 9:06am
Thank You, I'll give that a try and let you know how it worked out.
IP IP Logged
npatel
Newbie
Newbie


Joined: 16 Dec 2010
Location: United States
Online Status: Offline
Posts: 20
Quote npatel Replybullet Posted: 20 Dec 2010 at 1:41pm
Thank You that worked perfectly.
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.