Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Forecasting record count for future years

Hi.

I have Year and Record count

I want to forecast the record count for future years(2012,2013,2014 etc for 10 years). I tried using Forecast option but it is not showing values.

        Year              Recordcount

20083319123
20093030913
20104464960
20116016632

Please suggest me how to do this.

Thanks,

Anitha

1 Reply
Anonymous
Not applicable
Author

I am not aware of a forecast function within QlikView, and there are probably several ways to calculate forecasts let alone how to create the data in QlikView.  Here is one script example that you might use as a jumping off point:

Data:

LOAD * INLINE [

    Year, Val

    2008, 3319123

    2009, 3030913

    2010, 4464960

    2011, 6016632

];

LET vGrowth = (PEEK('Val',-1,'Data') - PEEK('Val',0,'Data')) / (NOOFROWS('Data')-1);

FOR i = 1 TO 10

JOIN (Data)

LOAD PEEK('Year',-1,'Data') + 1 AS Year,

          ROUND($(vGrowth) + PEEK('Val',-1,'Data')) AS Val,

          1 AS Is_Forecast

RESIDENT Data;

NEXT

Note that your data would have to be organized in ascending year order for this to work.  And I am assuming growth based on an average change each year.  I also added a flag to indicate the new rows are forecasts.

Aaron