5 Replies Latest reply: Aug 28, 2017 4:59 AM by Yuan Kai Tan RSS

    R integration: time series forecast append

    Stan Fischer

      Hi everyone,


      I am trying to append a forecasted time series to a line chart of closing values for a stock. Qlik Sense gives me  'erroe: client specified an invalid argument'. I don't understand what I'm getting wrong. Many thanks for your help.


      R.ScriptEval('library(forecast);data<-ts(na.omit(q$Variable1),frequency=1);fit<-auto.arima(data); res<-forecast(fit, level=0.95, h=q$vForecastPeriods); n <- length(q$Variable1); fore <- append(q$Variable1[(q$vForecastPeriods - 1):n],res$mean,after= n - q$vForecastPeriods); $fore;', Sum(Close) as Variable1, vForecastPeriods)