Time Series Prediction

Last week I was playing around with the Time Series algorithm - ok I was showing a customer - and I wanted to show the prediction language used to display the charts. So I used the tools and showed them the basic prediction query for forecasting, but I wanted to go further and show them cool stats like the variance and standard deviation of each predicted value. So I tried, and failed, and tried again, and failed, and after a few more furtive attempts had to admit to myself that I just didn't know (shame shame) how to get the standard deviation for a time series prediction.

But I didn't give up there - since you can see the deviations in the chart viewer, obviously you can get them from the server. I fired up my handy-dandy SQL Profiler, connected to my Analysis Server and viola! I pulled the query right out of the log! Immediately afterwards I had one of those "oh yeah" moments where you realize that you knew (or should have guessed) all along but had a brain dead moment and simply spaced.

In any case, the syntax you need to use is not trivial and no one not on the development team is likely to guess out of thin air, so I wrote up this tip explaining the convoluted syntax for the world to see. Once you see it, you won't likely forget it, and if you do - grab the profiler and puul it out, just like the dev team does!