We help IT Professionals succeed at work.

Populate Table with "trendline"

Medium Priority
Last Modified: 2012-05-05
Has anyone added a trendline to an excel chart then, set that line to forcast out a certain number of periods?  The chart control in SQL Reporting Services does not have the trendline or forcast option.

I would like to populate a table with these trendline data points, including forecast, and then make a chart from that.  I am looking for a way to derive these trendline data points from a given dataset.

I am looking for someone to point me in the right direction.  Possible a stored procedure solution that accepts  a table as input?  My data will look like this.

1/14/2008      15,116,494
1/16/2008      15,238,909
1/22/2008      15,249,179
1/25/2008      15,336,006
1/28/2008      15,342,146
Watch Question

Hi donnatronious,

I believe you'll either need to learn some statistics and include the future points as calculations in your SELECT statement, or you can save the values as a comma-separated file (Excel .csv) and use the BULK INSERT statement to bring the data into your table:

BULK INSERT Northwind.dbo.[Order Details]
    FROM 'f:\orders\lineitem.tbl'
            FIELDTERMINATOR = '|',
            ROWTERMINATOR = '|\n'

Open in new window

This link has code that demonstrates predicting future values via a trend line.  You should be able to convert this to a stored procedure to do what you need.  The dates may or may not work on the x axis, but you can give it a try and if it doesn't add an index that coresponds to each day.

the bottom of the page has the code you need, and an example.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.