Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

simonegabrielli
New Contributor

Call R library(Benchamrking) from Qlik

Hello everyone, 

I tried to run this in Qlik Sense Desktop, using the R library called Benchmarking:

SSELoad2:
Load
INPUT1,
INPUT2,
OUTPUT1,
OUTPUT2,
OUTPUT3,
OUTPUT4,


R.ScriptEval('library (Bernchmarking); dea(q$INPUT1, q$INPUT2) ;', INPUT1, INPUT2) as DEA

Resident SSELoad1;

But the SSEtoRserve return this error:

SSEtoRserve.RServeEvaluator|Rserve error: Error in library(Bernchmarking) :
there is no package called 'Bernchmarking'

Can i call this R package from Qlik Sense Desktop, with different methods ?

4 Replies
Highlighted
ErikWetterberg
Honored Contributor

Re: Call R library(Benchamrking) from Qlik

A typo? Or is it really called 'Bernchmarking'??

simonegabrielli
New Contributor

Re: Call R library(Benchamrking) from Qlik

Hi Erik, yes it is called Benchmarking

this is the link for the package: https://cran.r-project.org/web/packages/Benchmarking/index.html

ErikWetterberg
Honored Contributor

Re: Call R library(Benchamrking) from Qlik

But the error message says:

SSEtoRserve.RServeEvaluator|Rserve error: Error in library(Bernchmarking) :
there is no package called 'Bernchmarking'

Bernchmarking - is it simply a typo in your code??

simonegabrielli
New Contributor

Re: Call R library(Benchamrking) from Qlik

Yes, you are right is it a typo. I correct the script in the Load Script Editor  like this:

DEALOAD:
LOAD


DMU,
INPUT1,
INPUT2,
OUTPUT1,
OUTPUT2,
OUTPUT3,
OUTPUT4

FROM [lib://dati/deaDB.xlsx]
(ooxml, embedded labels, table is Sheet1);

 

SSELoad:
Load
INPUT1,
INPUT2,
OUTPUT1,
OUTPUT2,
OUTPUT3,
OUTPUT4,

R.ScriptEval('cbind(q$INPUT1, q$INPUT2);', INPUT1, INPUT2) as X,

R.ScriptEval('cbind(q$OUTPUT1, q$OUTPUT2, q$OUTPUT3, q$OUTPUT4);', OUTPUT1, OUTPUT2, OUTPUT3, OUTPUT4) as Y

Resident DEALOAD;


SSEload2:

LOAD
X,
Y,


R.ScriptEval('library(Benchmarking); dea(q$X, q$Y);', X, Y) as DEA

Resident SSELoad;

 

But the SSEtoRserve returns this error:

 

SSEtoRserve.RServeEvaluator|Evaluating library(Benchmarking); dea(q$X, q$Y);
INFO|SSEtoRserve.RServeEvaluator|Param names: X Y
WARN|SSEtoRserve.RServeEvaluator|Rserve error: Error in dea(q$INPUT1) : argument "Y" is missing, with no default

WARN|SSEtoRserve.RServeEvaluator|Rserve Traceback: dea(q$INPUT1)

Do you have any idea ? thanks for your help !