试图计算滚动12个月的平均值(是新访问的) [英] Trying to calculate a rolling 12 month average ( was new to access)
问题描述
您好,
我是Access的新手,并尝试根据某些时间数据计算滚动的12个月平均值。每个数据点都是该日期的日期和测量值。据我所知,采用滚动平均值的唯一方法是在去年创建所有数据点的生成表。然后创建一个查询以提取最小日期,创建第二个查询以拉出最大日期,创建第三个查询以从最小日期提取测量值,并创建第四个查询以提取最大日期的度量。最后,创建一个fith查询来平均最小/最大测量值。
似乎应该有一种更有效的方法来做到这一点。有什么建议吗?
谢谢!
您好,
我是Access的新手,并尝试根据某些时间数据计算滚动的12个月平均值。每个数据点都是该日期的日期和测量值。据我所知,采用滚动平均值的唯一方法是在去年创建所有数据点的生成表。然后创建一个查询以提取最小日期,创建第二个查询以拉出最大日期,创建第三个查询以从最小日期提取测量值,并创建第四个查询以提取最大日期的度量。最后,创建一个fith查询来平均最小/最大测量值。
似乎应该有一种更有效的方法来做到这一点。有什么建议吗?
谢谢!
你好。
同样的查询可以通过两个子查询来完成。
>展开 | 选择 | Wrap | 行号
你好。
具有两个子查询的单个查询可以完成相同的操作。
展开 | 选择 | Wrap | 行号
< blockquote class =post_quotes>
谢谢Fish,非常有帮助。
虽然我没有清楚地描述平均值。我不想取两次测量的平均值,我实际上想要花时间导数。而不是(meas1 + meas2)/ 2,我想要(meas2-meas1)/(date2-date1)。要了解测量结果的增长速度。
好的。
下次请不要犹豫,叫它的名字:D >
您需要以什么单位计算时差 - 小时,天,月?
Hello,
I''m new to Access and trying to calculate a rolling 12 month average from some time data. Each data point is a date and a measurement taken at that date. As far as I can tell, the only way to take the rolling average is to create a make-table of all the data points within the last year. Then create a query to pull out the minimum date, create a second query to pull out the maximum date, create a thrid query to pull out the measurement from the minimum date, and create a forth query to pull out the measurement for the maximum date. Finally, create a fith query to average the min/max measurements.
Seems like there should be a more efficient way to do this. Any suggestions?
Thanks!解决方案Hello,
I''m new to Access and trying to calculate a rolling 12 month average from some time data. Each data point is a date and a measurement taken at that date. As far as I can tell, the only way to take the rolling average is to create a make-table of all the data points within the last year. Then create a query to pull out the minimum date, create a second query to pull out the maximum date, create a thrid query to pull out the measurement from the minimum date, and create a forth query to pull out the measurement for the maximum date. Finally, create a fith query to average the min/max measurements.
Seems like there should be a more efficient way to do this. Any suggestions?
Thanks!Hello.
The same may be done by a single query with two subqueries.
Expand|Select|Wrap|Line Numbers
Hello.
The same may be done by a single query with two subqueries.
Expand|Select|Wrap|Line Numbers
Thanks Fish, very helpful.
Although I didn''t quite describe the averaging clearly. I don''t want to take the average of the two measurements, I actually want to take the time derivative. Instead of (meas1+meas2)/2, I want (meas2-meas1)/(date2-date1). To find out at what rate the measurement is increasing.Ok.
Next time please don''t hesitate to call a thing by its name :D
In what units you need to calculate time differential - hours, days, months?
这篇关于试图计算滚动12个月的平均值(是新访问的)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆