tag:blogger.com,1999:blog-1378961241059327992.post7881584905238332685..comments2023-04-05T09:35:55.180+02:00Comments on KiBeHa: Analytic sales forecastKim Berg Hansenhttp://www.blogger.com/profile/06491635470794828550noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-1378961241059327992.post-7971077066618174392019-08-14T20:24:03.655+02:002019-08-14T20:24:03.655+02:00Hi, Fredrik
Well, what forecasting model would fi...Hi, Fredrik<br /><br />Well, what forecasting model would fit your data? That is the big question ;-)<br /><br />In this example I do an extremely primitive model that simply transposes points on the graph linearly. I have written an article (<a href="http://bit.ly/kibeha_forecast_SQL_article" rel="nofollow">http://bit.ly/kibeha_forecast_SQL_article</a>) about using a slightly more advanced (though still fairly primitive) time series model.<br /><br />But both models are best for data with a seasonal/cyclic variation. In my case monthly datapoints in a yearly cycle. Daily datapoints in a monthly cycle has the problem that there are not the same number of days in each month, which in these primitive models are tricky. If the cycle is weekly, you could use the model to forecast 4 weeks based on 52 weeks history, for example.<br /><br />However, if you don't know already that your data fits some sort of cyclic time series predictive model, it will usually give better results to use a forecasting tool instead of modelling it manually in SQL. If you have the license for Advanced Analytic Option, you can use the data mining packages for this (I have no experience myself with this.) If you don't have the license, you can pull out the data and use other tools like R or Python. Again I am not an expert, but I have written another article on using R (<a href="http://bit.ly/kibeha_forecast_R_article" rel="nofollow">http://bit.ly/kibeha_forecast_R_article</a>), where the forecasting functions in R can automatically try out many models and pick the one that fits the data best.<br /><br />Having said that, here's a quick example of doing the very simple forecasting of this post on a daily basis: <a href="https://livesql.oracle.com/apex/livesql/s/itd3qkums22bux4icxv3qit5p" rel="nofollow">https://livesql.oracle.com/apex/livesql/s/itd3qkums22bux4icxv3qit5p</a><br /><br />In that LiveSQL script I create 500 days of history (2018-12-31 and 500 days back). For all days in december I calculate the slope based on 1 year backwards from that day. This I use to transpose every day of december 31 days forward as a forecast of january. It is as stated a rather primitive forecasting model I use, but if you can put it to some use, go right ahead :-)<br /><br />Cheerio<br />/Kim<br />Kim Berg Hansenhttps://www.blogger.com/profile/06491635470794828550noreply@blogger.comtag:blogger.com,1999:blog-1378961241059327992.post-55812713535062433782019-08-12T12:40:37.763+02:002019-08-12T12:40:37.763+02:00Kim
I'm not good in programming SQL but still...Kim<br /><br />I'm not good in programming SQL but still trying to make some sollutions. <br />Could you possible provide me with an example as above forecasting by date. I have a long history but thought of using one year history forecasting one month ahead.<br /><br />Best <br />Fredrik BjønnessFredrikhttps://www.blogger.com/profile/17822578339749743168noreply@blogger.comtag:blogger.com,1999:blog-1378961241059327992.post-31077118160140069282012-03-21T08:59:32.770+01:002012-03-21T08:59:32.770+01:00great post Kim.
thanks.great post Kim.<br />thanks.bakihttps://www.blogger.com/profile/15365538596927307970noreply@blogger.com