Newbies Kevin Kokesh Posted September 29, 2007 Newbies Posted September 29, 2007 Hi again, I'm sure this has been answered on here but the only thing I'm pretty sure of is that I need to change my summary fields to GetSummary fields...just not sure how to do it. I'm making a gradebook sort of thing with a points field and a points possible field. (If I get 8 out of 10 on an assignment, 8 goes in the points field and 10 in the possible field.) I made a report layout that categorizes the grades listing by class and so each class heading has a summary field that totals up the points and points possible from each class. Now I need a field that figures out the percentage of the subtotals. (If there are a total of 100 points in Math class, and I get 95 of those points, I need a field that calculates 95%) I'm guessing I will change the summary fields to GetSummary (not sure how) and then make the percentage a calculation of GetSummary [points] / GetSummary [possible] Thanks!
comment Posted September 29, 2007 Posted September 29, 2007 Read very carefully the help on GetSummary() function. Calculation fields using GetSummary() do NOT replace summary fields - they USE summary fields.
Newbies Kevin Kokesh Posted September 29, 2007 Author Newbies Posted September 29, 2007 That's what I thought originally when I read this (and other things like it) on the forums: [color:gray] "You need to use the GetSummary() function in order to reference a sub-summary in a calculation." (I think you said it, comment.) But then I read this: [color:gray] Question: I'm trying to figure out how to use division on summary fields in a subsummary part. Specifically: The subsummary is sorted on the hour of the day. For each of the 24 hours, a total number of traffic accidents is displayed (summary field) and a total number of fatal accidents is displayed (also summary field). I need the report to display the percentage of fatal accidents each hour. Simply dividing the one summary field by the other results in a "?". I assume there is a way to do this, but can't find it. Any help you could provide would hopefully bring this project to a merciful end. Answer: You cannot calculate based on Summary fields (as you have probably noticed). What you can do is this... instead of summary field(s), use calculated fields that use the GetSummary function. It will work exactly the same as the Summary fields, but will give you the ability to calculate off them. Which made me think that you could not divide one summary field by another summary field. This, then, kind of made sense to me since when I originally tried it in my database, it somehow divided the TOTAL points (not individual subtotals) by the TOTAL points possible (not individual) and thus gave me the same percentage under each category instead of finding each individual category's percentage. So OK, I need to use a getsummary function for the percentage field ,which will reference the two summary subtotal fields. Now what? Again, sorry for my lack of knowledge on the matter -)
comment Posted September 29, 2007 Posted September 29, 2007 If I am following correctly, you have two summary fields, one summing actual points and another possible points - let's call them sSumPoints and sSumPossible, respectively. And your layout has a sub-summary by Class part. In order to get the class ratio, you need a calculation field = GetSummary ( sSumPoints ; Class ) / GetSummary ( sSumPossible ; Class ) Note that this field is tailor-made for the sub-summary by Class part - it will not work well when placed in any other layout part (unlike a summary field). Another point worth noting is that the breakfield in GetSummary() cannot be a related field.
Newbies A China Posted October 2, 2007 Newbies Posted October 2, 2007 Your calculation may be working correctly. Check your field number formatting. It will return a decimal and it is probably overflowing your text box.
Recommended Posts
This topic is 6609 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now