MS Access 2010 报告组平均值
我对数据进行了如下分组:
Student
Class Type
Class Date
在班级日期下,我有日期、测试分数和班级平均数列。
如何获得给定日期的班级平均分? 谢谢
I have grouped my data like this:
Student
Class Type
Class Date
Under class date, I have Date, Test Score, and Class Average columns.
How can I get the class average for a given date?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将其放在班级组的页脚中。我总是喜欢将构成分数的两个部分引入,将它们相加然后除以得到平均值。
这样做的原因是简单的数学计算,如果你取一个已经聚合的数字的平均值,你实际上就给每个分数相同的“权重”。如果一个学生在该课程中参加了很多测试并取得了良好的成绩,那么这就是一个问题,它与参加 1 次测试并得分 10% 的学生具有相同的权重,当一次性考试时,明显拉低了平均分
You would put this in the footer of the class group. I always prefer to bring in the two parts that make up the score, add those up then divide them to get the average.
The reason for doing this is simple maths, if you take an average of an already aggregated figure you are effectively giving each score the same “weight”. This is a problem if a student has taken lots of test in that class and scored well it is giving it the same weight as someone who takes 1 test and scores 10% clearly pulling the average down when it was a one off
我要做的是
[Class Type]
和[Class Date]
进行内部联接(顺便说一句。如果您重命名这些名称中没有空格的表,您的查询和代码看起来会很麻烦Cleaner),[Class Type]
的主键和[Class Date].[date]
分组;然后在[Class Date].[Test Score]
上,将 GroupBy 更改为 Avg。[Student]
、[Class Type]
和[Class Date]
中所需的所有其他数据>;并将其内连接到[Class Type]
主键上的第一个查询(您可以对报告组进行小计,但我还没有找到一种很好的平均值方法)
What I would do is
[Class Type]
and[Class Date]
(btw. if you rename those tables without spaces in their names your queries and code will look a lot cleaner),[Class Type]
, and on[Class Date].[date]
; and then on[Class Date].[Test Score]
, change the GroupBy to Avg.[Student]
,[Class Type]
and[Class Date]
; and inner-join it to the first query on[Class Type]
's primary key(you can do sub total's for report groups, but I haven't found a way to do averages nicely)