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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

approach problem displaying Percentage based on two groupings 1

Status
Not open for further replies.

LikeThisName

Vendor
May 16, 2002
288
US
here is my dilemma, open to any approach

I have a report that is grouped by Year and then by Vote

in my Vote Header I use =Count(Vote) (displays Y total and N total)

in my Year Footer I use =Count(Vote) (displays Vote Total)

I need to calculate the percent of Vote in the Vote Header.
I know how to calculate a percentage but I don't know how to get the Denomitator to do it. Must I use multiple queries?

Thanks in Advance!

also in my count function Year and vote are interchangleable because of the way its grouped.

LikeThisName <- ? Sorry It's Taken =)
 
Are the values for Vote either Y or N?
Is Vote a yes/no field or is it a text field?
What exact percent do you want to calculate in the Vote header? CountOfYForTheYear/CountOfAllForTheYear? or something else?
Are there multiple years in the report?

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
thanks for your assistance dhookem,

i just finished reading the FAQ.

Are the values for Vote either Y or N? They are either Y or Null
Is Vote a yes/no field or is it a text field? Nope, its a text field.
What exact percent do you want to calculate in the Vote header? CountOfYForTheYear/CountOfAllForTheYear and
1-CountOfYForTheYear/CountOfAllForTheYear.

Are there multiple years in the report? Yes, 5 different years.

here is a sample of what i have

Related\Unrelated Frq

2003 <-Year Header
Related 300 <-Vote Header
Unrelated 520 <-
Total for 2003 820 <-Year Footer


2002
Related 400
Unrelated 930
Total for 2002 1330

here is a DESIRED SAMPLE

Related\Unrelated Pct Frq

2003
Related 36.5% 300
Unrelated 63.5% 520
Total for 2003 820

2002
Related 30.1% 400
Unrelated 69.9% 930
Total for 2002 1330

LikeThisName <- ? Sorry It's Taken =)
 
Is there a detail section? You seem to be only showing the group sections. Assuming these are all group sections:

You can add a text box in the Year header:
Name: txtCountYear
Control Source: =Count(*)
To get the percent in the Vote footer:
Control Source:=Sum(Abs([Vote]=&quot;Y&quot;))/txtCountYear
Also:
Control Source:=1-Sum(Abs([Vote]=&quot;Y&quot;))/txtCountYear


Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 

Duane,

MVP indeed! here is a star!

You were right on target. I had nothing in detail and nothing in the vote footer.

That solved it. You are a great asset here, I aspire to help more like you. Thanks again for enlightening me onhow to calculate this. I was way off in my logic.


LikeThisName <- ? Sorry It's Taken =)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top