2 Replies Latest reply: Nov 21, 2017 12:35 AM by Oguchi Nkwocha RSS

    KPI measure off R.ScriptEval() as Expression

    Oguchi Nkwocha

      I need to grab a value from R using R.ScriptEval() for KPI measure. The R code works and produces a discrete value. The Expression is "OK" ; but the KPI produces null (nothing, just a dash). Yes, Rserve and SSEtoRServe are both on.

      Any help is appreciated.

       

      Here's the Expression I am using:

       

      R.ScriptEval('library(TTR);library(forecast);newdata <-read.csv("sldsmp.csv");frcst <-forecast(ts(q$newdata$a1ccnt));frcst1 <-as.data.frame(q$frcst[2]);frcst2 <-round(q$frcst1[1,],0);q$frcst2')

       

       

      Here's the R code:

       

      library(TTR)

      library(forecast)

      newdata <-read.csv("C:/<...>/Documents/Qlik/sldsmp.csv")

      frcst <-forecast(ts(newdata$a1ccnt))

      frcst1 <-as.data.frame(frcst[2])

      frcst2 <-round(frcst1[1,],0)

       

      P.S:

      • removing "q$" in all but first instance does not make a difference.

       

      Here's the .csv file I am referencing:

      See attachment.

       

      Thank you!

       

      Oguchi