[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 717
  • Last Modified:

Populate Table with "trendline"

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
  • 2
1 Solution
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.

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now