Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Conditional Count 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: Conditional Count
     Posted: 11 Feb 2011 at 11:57am
I'm trying to create a running total with a distinct count for a field called vicidial_agent_log.lead_id, but each of these lead_id's are tagged with a result_code which is in the same table, but there can be multiple instances of the lead_id as the result_code can be different for each instance and so can the time they were changed. Essentially I wanted to know if there is a way that I can run a distinct count on the lead_id's where they only appear in the current day.

For Example:

LEAD ID    RESULT CODE      DATE
35518        CALLBK      2011-02-09
35518          NA2        2011-02-10
35518          YES        2011-02-11

So If were to run a lead count for the 9th it would return a 1, and if I were to run a lead count for the 10 or 11th, it would result 0's.

Let me know if there is any other information that you might need from me.

-Neal
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 14 Feb 2011 at 3:24am
creata a running total
name = todaycount (or whatever you want)
field to summarize=Lead ID
Type of summary = distinctcount
Evaluate = use a formula
table.date=currentdate
reset=never
place in report footer


Edited by DBlank - 14 Feb 2011 at 3:25am
IP IP Logged
npatel
Newbie
Newbie


Joined: 16 Dec 2010
Location: United States
Online Status: Offline
Posts: 20
Quote npatel Replybullet Posted: 16 Feb 2011 at 12:52pm
That still gives me numbers lead count numbers on the dates of the 10th and 11th. I don't think I was clear enough but, if I were to run that report ON the 10th or 11th it should result a 0, and if I run it on the 9th then and only then would it give me a 1. So regardless of the date range it would only count the first event.

Thanks in advance.

-Neal
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 17 Feb 2011 at 4:13am
so you want it to only count a record if the minimum date for any one leadid is = today?

Edited by DBlank - 17 Feb 2011 at 4:13am
IP IP Logged
npatel
Newbie
Newbie


Joined: 16 Dec 2010
Location: United States
Online Status: Offline
Posts: 20
Quote npatel Replybullet Posted: 17 Feb 2011 at 11:27am
Yes. Is that possible?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 17 Feb 2011 at 11:32am

group on leadid

change the RT evaluate formula to check for what you want
minimum({table.date},{table.leadid}) = currentdate
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