• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3872
  • Last Modified:

Crystal Reports - Countif

How to countIf a field = to a certain criteria.
My questions (Crystal 9).  I am working on a report where I have to count the number of instances in a fields.  Example: Field A; total of number X's, Total number of Y's in that field, Total numer of Z's.  I have tried using the countif FieldA = "X", which works in Excel but evidently not in Crystal.  
-Do I have to group first?
-If so, I do not want the group to show on the report, just the group totals.
-Is there a code such as "countif" that I can use instead of grouping?
Thanks
1
syhctl
Asked:
syhctl
1 Solution
 
bdreed35Commented:
You need to create a formula first, and then summarize the formula.

So your formula would look something like this:

//@X
if {table.field} = "X"
then 1
else 0

You can then go to the Insert menu, choose Summary.
Pick this formula, then sum, then the location where you want to summary to be.
Repeat for each different condition you need to summarize.
0
 
syhctlAuthor Commented:
Thanks so much..
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now