计算Access中的加权平均值 [英] Calculating Weighted Average in Access

查看:395
本文介绍了计算Access中的加权平均值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我目前正在尝试创建一个3个月的wieghted平均值来预测即将到来的月份。


我的表包含3个列(表ID),(日期),(每月总计)(表ID)包含数字1至31,(日期)从2005年1月1日至2007年7月1日。


我需要做的是做一个将累计过去三个月并计算加权平均值的查询。该平均值将是2007年8月1日的预测值。这是一个棘手的问题,我需要它来获取2007年8月1日的新预测数字,并将其与2007年6月1日和2007年7月1日的数字相结合,以预测2007年9月1日。这个过程需要重复到2008年底。


我也愿意听到我可以使用我在表格中包含的数据使用的任何其他预测方法。

Hello Everyone,

I am currently trying to create a 3 month running wieghted average to forecast the comming months.

My Table consits of 3 colums (Table ID), (Date),(Monthly Total). (Table ID) contains the numbers 1 to 31, (Date) runs from 1/1/2005 to 7/1/2007.

What I need to do is make a query that will add up the last three months and calculate the weighted average. That average would be the forecasted value for 8/1/2007. This is where it gets tricky, I need it to grab that newly forecasted number for 8/1/2007 and combine it with the numbers from 6/1/2007 and 7/1/2007 to forecast 9/1/2007. This process would need to repeat till the end of 2008.

I am also open to hearing any other forecasting methods I could use using the data that I have contained in my Table.

推荐答案

计算简单平均值是最简单的部分。以下是我的一个数据库中的示例:
Calculating a simple average is the easiest part. The following is a sample from one of my databases:
展开 | 选择 | Wrap | 行号


好吧,除非你还在运行A2000的版本,否则你'在我给你的那个链接上可能运气不好...在我检查之后我记得.Application扩展是MS决定的安全风险太大的事情之一,因此在A2003中禁用了。此链接在此讨论: http://www.databasedev。 co.uk/jet-sandbox-mode.html


问候,

Scott
Well, unless you''re still running a version of A2000, you''re probably out of luck on that link I gave you...After I examined it more I remembered that the .Application extension is one of the things that MS decided has too many security risks, and so is disabled in A2003. This link here discusses this: http://www.databasedev.co.uk/jet-sandbox-mode.html

Regards,
Scott


Ok !你的帖子激怒了我再去看看......这是我工作的代码。不幸的是,我要离开城镇直到Weds,但是如果你在我回来之前遇到问题,这里的其他人可以跳进去帮助你。 (任何人都可以自由地建议改进这个代码!它可能不是最有效的,但它对我有用:-)


你需要一个查询以提取您希望在预测中使用的数据。我正在使用这个SQL:
Ok! Your post provoked me to have another go at this... Here is the code for what I got to work. Unfortunately I''m going to be out of town until Weds, but someone else here can jump in and help you out if you run into problems with this before I get back. (Anyone is free to suggest improvements in this code as well! It may not be the most efficient, but it''s working for me :-)

You''ll need a query to pull the data you wish to use in forecasting. I''m using one with this SQL:
展开 | 选择 | Wrap | 行号


这篇关于计算Access中的加权平均值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆