Skip to Content

Get a Count of 'Yes' in a Crystal Report

I have a formula in the group header of my report that displays 'Yes' and I want a total count of these. The formula is:

if not isnull({CL_OSQ_OT.DISPLAY_NAME}) then 'YES'

How do I get a total of the Yes's ?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Mar 06, 2017 at 04:57 PM

    Create another formula

    @YesCount

    if not isnull({CL_OSQ_OT.DISPLAY_NAME}) then 1 else 0

    Then create a sum summary of this formula and place in report header

    Ian

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 06, 2017 at 07:13 PM

    I tried that but no success. I ended up adding a group for the formula. So now is prints a 0 for ones that are null and 1 for the ones that are not null. Is there a way to count all of the 1's that display in this group. See attached.capture.jpg


    capture.jpg (22.5 kB)
    Add comment
    10|10000 characters needed characters exceeded

  • Mar 07, 2017 at 07:58 AM

    Hi Curt,

    1. Create a formula with this code and place it on the Group Header:

    shared numbervar yc;
    if not isnull({CL_OSQ_OT.DISPLAY_NAME}) then 
    yc := yc + 1;
    '';

    2. Create another formula to display the count and place this on the Report Footer:

    shared numbervar yc;

    -Abhilash

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 07, 2017 at 05:13 PM

    Thank you Abhilash. That worked.

    Add comment
    10|10000 characters needed characters exceeded