473,376 Members | 1,079 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,376 software developers and data experts.

Moving average (how to calculate)

Hello,

I need to calculate moving averages of weekly data during the last
year.
After some search, I believe that the best approach will be to get a
dataset from the SQL Server database, browse the records and, using an
algorithm, calculate the moving average.

There is an article on the "Code Project" website entitled "A Simple
Moving Average Algorithm" but honnestly I have been unable to
implement the solution.

Any tip, pseudo code or existing algorithm will be most welcome,

Thanks for your help,

Michel
Aug 4 '08 #1
1 7563
JDS
On Aug 4, 6:02*pm, Michel <MichelCou...@gmail.comwrote:
Hello,

I need to calculate moving averages of weekly data during the last
year.
After some search, I believe that the best approach will be to get a
dataset from the SQL Server database, browse the records and, using an
algorithm, calculate the moving average.

There is an article on the "Code Project" website entitled "A Simple
Moving Average Algorithm" but honnestly I have been unable to
implement the solution.

Any tip, pseudo code or existing algorithm will be most welcome,

Thanks for your help,

Michel
There is a great article on Wikipedia that includes some pseudo code:
http://en.wikipedia.org/wiki/Algorit...ating_variance

This article also explains pros and cons of different methods.

If you need some example code let me know. I have some in C
(not .Net).

HTH

Jeremy.
Aug 4 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Stephen Miller | last post by:
Firstly, sorry for the long post, but I've included a fair bit of sample data. Im doing a comparision of 10yr Bond prices and CPI adjustments, with an 18 week moving average of the CPI. I'm...
2
by: Wayne Aprato | last post by:
I've read most, if not all, of the posts on moving average and still can't find a simple solution to my problem (if a simple solution exists!) I have a table with 2 fields: Hours and Injuries. I...
4
by: visu | last post by:
I want to know following memory space related question. 1 . How can i get a Database Size by means of a SQL query? 2. How can i Get a field size (not allocated space) .. ie. i am storing...
5
by: cecil | last post by:
Hi All, I have a report sectioned/grouped by year with number fields (i,e attendance). I would like to calculate percent difference of attendance for each year. Thanks in advance, Cecil
3
by: paeh | last post by:
hello..can anyone help me. I am beginner in programming. I need to make a system that can calculate moving average. my system process will be executed according to certain schedule such as daily,...
1
by: paeh | last post by:
can anyone tell me any ebook or website address that show the tutorial about moving average step by step.. urgent..please help me..
0
by: SuzK | last post by:
I am trying to calculate in VBA in Access 2002 a moving average and update a table with the calculations. Fields in my WeeklyData table are Week Ending (date) ItemNbr (double) Sales Dollars...
4
by: lenygold via DBMonster.com | last post by:
I found this example in MYSQL: create table events ( id integer not null primary key , datetime_start datetime not null , datetime_end datetime not null ); insert into events values ( 1,...
5
by: adarshyam | last post by:
Hi friends, I have an interesting problem in vb.net. And I am struggling to get a solution for this..m trying for the past 3days.. It’s to calculate moving average for the inputs given by the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.