Crystal Reports - Countif

Posted on 2007-08-08
Last Modified: 2008-01-09
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?
Question by:syhctl
    LVL 28

    Accepted Solution

    You need to create a formula first, and then summarize the formula.

    So your formula would look something like this:

    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.

    Author Comment

    Thanks so much..

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
    Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now