RE: Forcasting in Postgresql

From: <dave(at)davebolt(dot)co(dot)uk>
To: "'Govardhan (dot)G'" <govardhansrr(at)gmail(dot)com>, <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: RE: Forcasting in Postgresql
Date: 2023-03-02 17:47:19
Message-ID: 020b01d94d2f$0933ed60$1b9bc820$@co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

The short, unhelpful, answer is Yes.

Time to take a step back from the SQL and ask yourself:

Can I write an algorithm to forecast some value dependant on values I already have.

Very simple, somewhat vague, example.

I have been selling Snow Tyres for some time so I have values for sales along with dates.

What are the average sales for each month?

If I have more than one year’s data, what are the averages per month over the last X years?

Is a running average over the last few weeks/months/year any use?

Some made up figures.

Given that my average sales (in the Northern Hemisphere), were 20 in November, 18 in December, 2 in January, 3 in February, I might expect significant sales in November and December, but a drop in sales in January and February.

If last year the actual figures for November to February were 2,30,0,3, and the previous year were 38,6,4,3 then there is still a drop in sales in January and February, and still high sales in November and December, it’s just a little more complicated.

(If I were selling Snow Tyres, I would possibly look at these figures and get some stock in for November so that I would have stock on hand for the rest of the year, but now we are getting on to questions relating to order lead times).

I noticed that what I had intended to be a simple example quickly started to become more complicated.

I needed a clear definition of what I had, and what I wanted, so I tried to draw on my experience using a Stock Control System in the ‘80s and make up some easy data. I know that real systems that attempt to predict ordering quantities can soon get deep into Statistics, which is not one of my strengths. For this particular example I would be looking at search results for ‘stock management algorithm’ as a starting point.

Hope this helps a little.

Regards

Dave Bolt

From: Govardhan .G [mailto:govardhansrr(at)gmail(dot)com]
Sent: 01 March 2023 07:48
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Forcasting in Postgresql

Hi Folks,

Is it possible to write a query for forecasting in postgresql. I have been trying to search but have no clue. please advise

Thanks

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Govardhan .G 2023-03-02 17:51:26 Re: Forcasting in Postgresql
Previous Message Govardhan .G 2023-03-02 16:25:16 Re: Forcasting in Postgresql