试图计算滚动12个月的平均值(是新访问的)

编程入门 行业动态 更新时间:2024-10-28 06:36:18
本文介绍了试图计算滚动12个月的平均值(是新访问的)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

您好, 我是Access的新手,并尝试根据某些时间数据计算滚动的12个月平均值。每个数据点都是该日期的日期和测量值。据我所知,采用滚动平均值的唯一方法是在去年创建所有数据点的生成表。然后创建一个查询以提取最小日期,创建第二个查询以拉出最大日期,创建第三个查询以从最小日期提取测量值,并创建第四个查询以提取最大日期的度量。最后,创建一个fith查询来平均最小/最大测量值。 似乎应该有一种更有效的方法来做到这一点。有什么建议吗? 谢谢!

解决方案

您好, 我是Access的新手,并尝试根据某些时间数据计算滚动的12个月平均值。每个数据点都是该日期的日期和测量值。据我所知,采用滚动平均值的唯一方法是在去年创建所有数据点的生成表。然后创建一个查询以提取最小日期,创建第二个查询以拉出最大日期,创建第三个查询以从最小日期提取测量值,并创建第四个查询以提取最大日期的度量。最后,创建一个fith查询来平均最小/最大测量值。 似乎应该有一种更有效的方法来做到这一点。有什么建议吗? 谢谢!

你好。 同样的查询可以通过两个子查询来完成。

展开 | 选择 | Wrap | 行号

你好。 具有两个子查询的单个查询可以完成相同的操作。

展开 | 选择 | Wrap | 行号

谢谢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个月的平均值(是新访问的)

本文发布于:2023-10-30 13:40:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1543020.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:平均值   个月

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!