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

Grand Total to divide by 1

Status
Not open for further replies.

teqtaq

Technical User
Nov 18, 2007
197
US
Can you please, help me with dilemma.

I have a table

ID_______Prod1___Prod2___Prod3___Total
11_________5_______6_______7______18
12_________6_______6_______7______19
13_________5_______7_______8______20
Total_____16______19______22__GT:_57
**********************************************

The problem is now I need to have percentage of

Prod1/Total of Prod1 - 5/16
also
Prod1/GT - 5/57

for each Prod and ID. I am trying SUBs etc. but I can't figure out how to keep Grand Total to divide by.


Thanks
 
In the detail section of the report, you should be able to use a control source of:
[tt]
=[Prod1]/Sum([Prod1])
[/tt]
To get the percent of grand total
[tt]
=[Prod1]/Sum([Prod1]+[Prod2]+[Prod3])
[/tt]
Is your table structure actuall this un-normalized or is these columns the result of a crosstab?

Duane
Hook'D on Access
MS Access MVP
 
In your example we don't get to 57.
Sum of 3 prods gives us an 18,19,20

thanks
 
Don't "18,19,20" add up to 57? What did you do to trouble-shoot this?

What are the data types of Prod1, Prod2, and Prod3? When viewed in datasheet view, do they appear left or right aligned?

If left, then they are being handled as text rather than numeric. This would raise the question where the ProdX values are coming from.

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top