Print Page | Close Window

count of multi select responses

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Tips and Tricks
Forum Discription: Have you learned some great tricks to share with the group? Post them here!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=14986
Printed Date: 16 May 2024 at 6:10pm


Topic: count of multi select responses
Posted By: bluelake
Subject: count of multi select responses
Date Posted: 21 Nov 2011 at 4:57am

How can I count the number of responses for each choice in a multi-select field?  I want the number of A's, B's, C's, etc.




Replies:
Posted By: comatt1
Date Posted: 02 Dec 2011 at 5:17am
using running totals you could; would each record only have a single value, but multiple potential options.
 
If so
 
running total - name
field to summ - {grade}
type - count
 
evaluate
formula -
{grade}='A'
 
Reset
Never (if wanting over whole report)
 
-------------
 
You would have to do this for each option-grade.
 
Otherwise, I would probably use shared variables.
 
in header define an initvar formula (leave in report header)
 
shared numbervar a=0;
shared numbervar b=0;
shared numbervar c=0;
...
 
Within the detail field, suppress a formula and have something like this
if {grade}='A' then
a:=a+1
else
if {grade}='B' then
b:=b+1
else
...etc
 
.....
 
In a footer you can then just list them  in a formula:
 
'Number of A scores: ' + a + char(13) +
'Number of B scores: ' + b + char(13) +
... etc
 
 



Print Page | Close Window