Solved

# Create a conditional summary using Crystal Reports

Posted on 2008-11-18

i have a dataset with a field called TYPE. The data contains 3 different types, "A", "B" and "C".

I would like to use Crystal Reports to count how many records are of type "A", how many of type "B" and how many of type "C". The field is a string so simply TYPE = "C" will tell me if it is type "C".

Crystal Reports has a Set of Summary functions available in the Formula Editor. One of the functions is Count() which counts the number of records. The parameters are

Count(fld), Count(fld,condFld) or Count(fld,condFld,value).

Is there any way to do this. I tried making a new formula field called TYPEAT such that

if TYPE="A" then

formula = true

else

formula=false

end if

then I tried a second formula field typeac

count(TYPE,TYPEAT)

Thinking that TYPEAT IS NOW A CONDITIONAL FIELD. The formula editor will not accept this.

I can use parameter fields and perform the calculations in the main program, but i would like to use a conditional count formula.

Can this be done with Crystal Reports????