Percentage of a Group IF.

Printed From: Crystal Reports Book — Forum Name: Technical Questions

Hi all

Im trying to work out how I what a percent of a total is of the group.

623458 <- grouped     Total
623458   Cable 1mm     12
623458   Cable 2mm     0
623458   Cable 4mm     4
623458   Cable 7mm     0
623458   Cable 10mm    5

I need to total up the items that are 0 and display it as a percentage of that group. In this case it would be 40%.



not sure how to go about it.
shared variables would work...

Way too late I fear.
The basic idea is to reset the counters when the grouping changes...it looks like when 623458 changes.

The increment part would be in the details section and would be something like:

shared totCount := totCount + 1;
shared zeroCount;
if {field} = 0 then zeroCount := zeroCount + 1;

HTH