Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find a percentage of a total of counts 1

Status
Not open for further replies.

Erv7

Technical User
Joined
Oct 27, 2008
Messages
5
Location
US
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???
 
I am using cr8.0
 
You should be referring to group and report sections, not "lines". If you mean you have a count at a group level, and you want a percentage based on the grand total, then use a formula like this:

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
 
Ok, I got this one -- here's another -- when I try to total a column containing a formula which is

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.
 
You need to show the content of the formula.

-LB
 
Sorry I wasn't more expedient on my reply -- still
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!
 
First, I believe you are in the wrong forum--try forum149 or forum767 in the future.

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
 
This worked very well -- I thank you.

I will certainly look at the other forums if I need further help -- Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top