Qlik Community

Qlik Server Side Extensions Documents

Documents related to Server-Side Extensions and Advanced Analytics Integration.

Qlik AAI Load Script Example - R v2 (Qlik Sense)

Employee
Employee

Qlik AAI Load Script Example - R v2 (Qlik Sense)

This UPDATED - from version 1: Qlik AAI Load Script Example - R (Qlik Sense and QlikView)‌ - brief document and attached files are intended to get you up and running with a simple example, a template, using Advanced Analytics Integration (AAI) in Qlik load script. Included example is for Qlik Sense, specifically.  The use case is scoring of a data set using an advanced algorithm in R during a data load.


Since the February 2018 release of Qlik Sense, AAI supports whole table processing in the load script natively.

Thank you bbb (Steven Pressland) for explaining its use (An Advanced Analytics Integration Timeline😞  "When writing your application script there is now an extended syntax to the load statement, like the FROM or RESIDENT statements that have their specific uses. Qlik can now use the reserved statement, EXTENSION, to specify that the source of the loaded data table will be the result of an AAI function."  Look for "Extension R.ScriptEval()" in the example  load script.


Equivalent QlikView functionality will come in a future release.  Until then, continue to use my QlikView November 2017 example found here: Qlik AAI Load Script Example - R (Qlik Sense and QlikView)‌.  For your convenience, that QVW is also bundled in with this example.



Attachments
Comments
Partner
Partner

Thanks!! This is a great post!!

0 Likes
adang
Explorer III

Hi Brian, thank you very much for the great post! The QlikView example works if it's reloaded in QlikView, but it could be reloaded through QMC. Do you know why?

I got an error saying:

"Unexpected token: '(', expected one of: ',', ':', 'OPERATOR_PLUS', 'OPERATOR_MINUS', 'OPERATOR_MULTIPLICATION', 'OPERATOR_DIVISION', 'OPERATOR_STRING_CONCAT', ..."

Connectivity from the QMC server to the R server works, when I call an R function through chart expression.

QlikView and R Integration for Predictive Analytics Example

0 Likes
pthanuj1990
New Contributor

error.PNGWhen  I try to reload the Qlikview script it through me error(attached). what could be possible reason???. We have the Qlikview 2017 version and are using AAI SSE connector .  I am unable to run my R script on Qlikview .Please suggest a possible solution

0 Likes
Employee
Employee

Are you absolutely certain you have the SSE for R configured properly and running?  The error indicates QlikView is unable to find the SCRIPTEVALSTR function under the connector named R.  Review the document titled, Installing R with QlikView.pdf.  After you pass that hurdle, ensure you have all the necessary R libraries - including medicalrisk, as mentioned in my accompanying document.  You should see any complaints about missing libraries in the SSEtoRserve.exe command window.

0 Likes
pthanuj1990
New Contributor

Where should I install the medicalrisk library?? Should I have another Line as

R.scripteval('Install.packages("medicalrisks")') ? or Install it in the R-studio that is running on the server ?? 

0 Likes
Employee
Employee

You'll need to install it on your server.  If you're missing the medicalrisk package, the information about installing it is on page 3 of the PDF titled "Qlik AAI Load Script Example - R v2.pdf" (Step 1 - under Configure and Run the Example):

We’ll start by opening your R x64 console and install a specific package needed to run the example. The package is called medicalrisk. In the R console, type:  install.packages("medicalrisk")
 
0 Likes
Version history
Revision #:
1 of 1
Last update:
‎2018-05-21 08:28 PM
Updated by:
Employee