Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Counting 'TRUE' fields Post Reply Post New Topic
Author Message
jgarner
Senior Member
Senior Member


Joined: 23 Jan 2009
Location: United States
Online Status: Offline
Posts: 159
Quote jgarner Replybullet Topic: Counting 'TRUE' fields
     Posted: 05 Nov 2009 at 6:50am
I'm using a formula for a true/false field in Crystal XI to make this a checkbox:
If {tblGrantRevisit.PEG2WilliamsUnit} = True Then
         Chr(254)
Else
         Chr(168)
with wingding font.
I would like to know if there is a way to count the fields that are checked (true). I am assuming a formula might work since the SUM icon does not appear to have this capability?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 Nov 2009 at 7:24am

You can do that in 3 basic ways.

1. Use a formula to do 1 or 0 then sum that
if {tblGrantRevisit.PEG2WilliamsUnit} then 1 else 0
(This can be used in a header the otehr 2 must be used in footers)
2. use a variable formula to do this (not my thing but tons of examples on this site)
3. use a Running total to this:
New Running Total
name=CheckedCount
Field to summarize={tblGrantRevisit.PEG2WilliamsUnit}
Type of Summary= Count
Evaluate= Use a formula
{tblGrantRevisit.PEG2WilliamsUnit}
Reset = Never


Edited by DBlank - 05 Nov 2009 at 7:25am
IP IP Logged
jgarner
Senior Member
Senior Member


Joined: 23 Jan 2009
Location: United States
Online Status: Offline
Posts: 159
Quote jgarner Replybullet Posted: 05 Nov 2009 at 8:27am
Thanks DBlank. I used your 3rd example and it worked great.
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