Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Count if formula Post Reply Post New Topic
Author Message
remdev
Newbie
Newbie


Joined: 21 Jan 2011
Location: United States
Online Status: Offline
Posts: 2
Quote remdev Replybullet Topic: Count if formula
     Posted: 21 Jan 2011 at 7:52am
All
Many thanks for your patience for such a newbie question!
I need to get a count of records where a specific field has a specific value.
I've tried a number if different ways and some of those had different field format (parens, no parens; curly brackets, no curly brackets; dbl quotes, single quotes, tics) which only confused me even more.
 
It would look something like this.
 
COUNTIF ("Survey"."Survey_was_administered_By")= "Phone"
Return 0 if no rows match
 
This is further complicated because this is an enumerated field. In this case Phone would be 0.
 
The report is running against a Remedy database if that makes a difference.
 
Any syntax help or thoughts greatly appreciated!!
 
Pete
BOXI (11.0.0.2495)
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 21 Jan 2011 at 8:23am
you can do this a few ways
1. since you do not have duplciate data or whant a distinct count make a formula as 
If ("Survey"."Survey_was_administered_By")= "Phone" then 1
Sum this formula field
2. use a running total with an evaluate formula
("Survey"."Survey_was_administered_By")= "Phone"
3. Use variable formula to mimic the same thing as option 2

IP IP Logged
remdev
Newbie
Newbie


Joined: 21 Jan 2011
Location: United States
Online Status: Offline
Posts: 2
Quote remdev Replybullet Posted: 22 Jan 2011 at 9:57am
That works many thanks!!
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