Percentage function in a report

G

Guest

Hi
Can you please help me with this function.
I have report which pulls out records between two dates(from a query) and
groups them under four groups. I need to count number of records in each
category. i used count(*) in the group footer. it works fine. It shows the
count in each group
next I need the percentage of this count in each group.
For eg:
Group 1
Count :2 percent:25%

Group 2
Count :2 percent:25%

Group 3
Count ;4 Percent: 50%

Group 4
Count:0 Percent:0%

Total :8 Total percentage;100%

How do I achieve this percentage in a report. If i have to write a code. Can
you tell me how it goes and where should I include and call it.
Thank you so much
 
M

Marshall Barton

accessfremont said:
I have report which pulls out records between two dates(from a query) and
groups them under four groups. I need to count number of records in each
category. i used count(*) in the group footer. it works fine. It shows the
count in each group
next I need the percentage of this count in each group.
For eg:
Group 1
Count :2 percent:25%

Group 2
Count :2 percent:25%

Group 3
Count ;4 Percent: 50%

Group 4
Count:0 Percent:0%

Total :8 Total percentage;100%

How do I achieve this percentage in a report.

It looks like you want to divide the group count by the
total count. If so, add a text box (named txtTotalCount) to
the report header section and set its expression to
=Count(*)

Then the group header/footer text box can display the
percentage by using the expression:
=Count(*) / txtTotalCount
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top