Jump to content

Perform operations with summary fields


This topic is 6107 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

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!

Link to comment
Share on other sites

  • Newbies

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 :(-)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 6107 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.