Skip to Content
0

Get a Count of 'Yes' in a Crystal Report

Mar 06, 2017 at 04:27 PM

62

avatar image

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 ?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Ian Waterman Mar 06, 2017 at 04:57 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Curt Othmer Mar 06, 2017 at 07:13 PM
0

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)
Share
10 |10000 characters needed characters left characters exceeded
Abhilash Kumar
Mar 07, 2017 at 07:58 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Curt Othmer Mar 07, 2017 at 05:13 PM
0

Thank you Abhilash. That worked.

Share
10 |10000 characters needed characters left characters exceeded