## Find a percentage of a total of counts

## Find a percentage of a total of counts

(OP)

I am trying to make a summary-type report where one column shows a count of entities used to make that line. I have a total of all the counts in the report footer line. I want to make a column that shows the percentage of counts relative to the total number of counts. Any suggestions???

## RE: Find a percentage of a total of counts

## RE: Find a percentage of a total of counts

count({table.entity},{table.groupfield}) % count({table.entity})

Not sure whether you want this to be a distinctcount or not, but edit as necessary.

-LB

## RE: Find a percentage of a total of counts

sum (calculation)

I get the error message: The summary / running total field cannot be created.

I am using cr ver 8.0

Is there any way around this???

Thanks in advance.

## RE: Find a percentage of a total of counts

-LB

## RE: Find a percentage of a total of counts

learning the group protocol.

Anyway, in the Group 1 Header I have the following:

column for item numbers

column for count of item numbers

column for sum of weight

column for percentage of sum of weight

column for pieceweight

formula @pcs

sum ({wt},{item})/{piecewt}

the above error occurs when I try to total @pcs

I am truly appreciative of your support!

## RE: Find a percentage of a total of counts

You cannot insert sums on formulas that already contain summaries or that use any function that requires a sequential evaluation of records, like Previous() or next(). In this case, you would need to use a variable to sum your formula. The following assumes you are summing at the grand total level:

//{@accum} to be placed in the section containing the {@pcs} formula:

whileprintingrecords;

numbervar sumpcs := sumpcs + {@pcs};

//{@display} to be placed in the report footer:

whileprintingrecords;

numbervar sumpcs;

-LB

## RE: Find a percentage of a total of counts

I will certainly look at the other forums if I need further help -- Thanks again.