Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
2008 | 3319123 |
2009 | 3030913 |
2010 | 4464960 |
2011 | 6016632 |
Please suggest me how to do this.
Thanks,
Anitha
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