Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
mitasid
Yak Posting Veteran
51 Posts |
Posted - 2009-04-02 : 16:28:38
|
| Hi GuysI need to calculate the rolling averages for the cost of employees for 5 years by taking Jan 2001 till dec for the first period and averaging the rest of years' data. to smooth out the trend lines for a graph.Here is the sample data for your referenceEmployee_code Year Month Cost 12 2001 1 $500011 2001 2 $122211 2001 3 $12444...144 2005 12 $8555In my graph I want to plot the Cost on Y axis and on X axis I have to plot Year and month along with the Doctor count for each month. Any suggestion guys??Thanks |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2009-04-02 : 17:14:00
|
| >>Any suggestion guys??try clicking the search link above and searching for rolling average. Lots of topics with examples.Be One with the OptimizerTG |
 |
|
|
mitasid
Yak Posting Veteran
51 Posts |
Posted - 2009-04-02 : 19:02:58
|
| Hey thanks TGI had a look at the posts in search but could not find anything specific which matched my query.Could you please give me the actual TSQL for solving this??Thanks |
 |
|
|
|
|
|