Advertisement

07.11.2008 at 11:08AM PDT, ID: 23558086
[x]
Attachment Details

how to create data set for trailing sales graphs

Asked by softdimensions in SQL Server 2005, Databases Miscellaneous, MS SQL DTS

Tags: sql server 2005 - t-sql/stored procedure

I need a way to create a graph of trailing sales numbers.  The graphing is the easy part, I need to know the most efficient way to create the stored procedure that will feed the data to the graph.  To make this simple consider a table of 3 columns. AccountingPeriod,Sales,Organization.  There will be multiple rows for the values in the table.

200803,$12000,02
200803,$14000,03
200803,$11000,01
200803,$12500,02
200803,$14500,03
200803,$11500,01

etc...

To create the trailing data set I need to get the data points in 12 months summed so that point #1 would be 200703 - 200802 and contain the sum of all sales figures for a particular org over that time period  Point # 2 would be 200704-200803 and contain the sum of all sales figures for a particular org over that time period .   I need to get 12 points in this manner to plot a trailing graph.  

Any thoughts would be appreciated.Start Free Trial
 
Loading Advertisement...
 
[+][-]07.12.2008 at 03:54AM PDT, ID: 21988636

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.12.2008 at 09:35AM PDT, ID: 21989676

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: SQL Server 2005, Databases Miscellaneous, MS SQL DTS
Tags: sql server 2005 - t-sql/stored procedure
Sign Up Now!
Solution Provided By: cedlinx
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628