Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW

Qlik AAI Load Script Example - R (Qlik Sense and QlikView)

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Brian_Bauer
Former Employee
Former Employee

Qlik AAI Load Script Example - R (Qlik Sense and QlikView)

Last Update:

Apr 2, 2021 4:17:41 AM

Updated By:

Brian_Bauer

Created date:

Sep 22, 2017 12:04:30 PM

Attachments

This 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 are Qlik Sense and QlikView examples.  The use case is scoring of a data set using an advanced algorithm in R during a data load.


UPDATE: There's an newer version of the example to highlight a capability first introduced in Qlik Sense February 2018.  That is whole table processing between Qlik and other engines via AAI.  The new example is based on this initial one posted in September 2017 and uses R as well.  See it here:  Qlik AAI Load Script Example - R v2 (Qlik Sense)‌.



Comments
michal
Partner - Contributor III
Partner - Contributor III

Many thanks for this re-usable example !

0 Likes
jibe1982
Contributor
Contributor

Hello!

I'm jibe. I work as a data analyst in a french hospital.

Many thanks for this example. It was so useful to get me in Qlik/R work. Sorry I don't speak english very well.

After trying, your example, I began working with a tiny data set, just to try to create a table in Qlik from load script.

It works fine with numeric data but if the data I want to send to Rserver is  a string, then it don't works.

Here is the Qlik script part:

TAB_R:

NoConcatenate

LOAD

ident,

nom,

prenom

Extension R.ScriptEval('$(RSource2)',PATIENTS{IPP_PATIENT, ID_PATIENT_TB_PATIENT,PRENOM_PATIENT});

STORE TAB_R INTO [$(inputpat2)] (txt);

and here the Rscript part:

donnees<-data.frame(ident=q$ID_PATIENT_TB_PATIENT,nom=q$IPP_PATIENT,prenom=q$PRENOM_PATIENT);

#donnees[donnees$prenom=="ROBERT",];

res=donnees[donnees$ident=="8257",];

 

It works well with ident filter (a numeric one) but doesn't work with prenom filter (string). When looking at the output file,  I can see the variable prenom isn't the right one(I've got numeric values instead of strings).

Somebody can help me?

Thanks a lot.

0 Likes
Version history
Last update:
‎2021-04-02 04:17 AM
Updated by: