Qlik Community

Qlik Server Side Extensions Discussions

Discussion Board for collaboration on Server-Side Extensions and Advanced Analytics Integration.

hchen1800radiat
Not applicable

call R package from Qlik

I have loaded several SQL tables into Qlik, now I want to input one of the table into R to do some analysis using the package I built in R

For example:

table1, table2 and table3 are loaded into Qlik and are linked with each other by a common column 'CampaignID'.

I built a R package named 'calc_score' with only one function inside 'calculate_score(table,median_date)', and this function will return a dataframe

now I tried to run this in Qlik:

R.ScriptEval('install.package('calc_score');library('calc_score') ; calculate_score(table = table1 , median_date = table1$median_date $week' , [median_date] as median_date)

but there is an error 'Internal Engine Error'

Is that because I cannot install package or library within the script? or is it because I need to use 'q' instead of 'table1' inside the script? but as I have three tables loaded, how can I differentiate table1$median_date and table2$median_date?

1 Reply
bvk
Not applicable

Re: call R package from Qlik

Yes, you need to put q$median_date into you R expression. The connector will pass the data into this parameter.

Also have a look at the output of the SSEtoRserver application, this provides hints as to why things are not working.

Regards,

Bas.

Community Browser