Skip to main content

Integration, Extension & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Action-Packed Learning Awaits! QlikWorld 2023. April 17 - 20 in Las Vegas: REGISTER NOW
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using Nested R Functions with Qlik Sense Extension, R, and Open CPU Integration Approach with Open CPU Defaults?

Hello, as someone with a fair amount of R experience who is brand new to Qlik, I was very excited to find some of the work that has been done to create Qlik Sense Extensions that use R's capabilities via Open CPU:

Unfortunately, I am struggling to figure out how to use some basic R commands in this setup because I will have to use the default Open CPU R packages and so cannot create custom R functions as in GitHub - aasensior/sense-r: Functional examples on integrating Qlik Sense and R.

For example, how would one return the R console output for the summary (to see significance levels and more) of a linear regression object in this setup?  In R, using the packaged "cars" dataset, that might be done with "summary(lm(cars$speed~cars$dist))".  However, I am not sure how to nest the "lm" function within the "summary" function, especially when the "summary" function is found in and "lm" in

The function "lm" alone is used around line 69 in

How would that script need to be changed to return the summary of the linear regression object instead?

These may be beginner questions, but any help would be greatly appreciated!

1 Reply
Not applicable

There is a function summary.lm (look at This can be called with the result of the lm function.

OpenCPU - JavaScript Client‌ explains how to combine function calls by sending the session key of the first function call (lm) to the summary.lm function.

An example:

var req1 ="rnorm", {n: 100}, function(session1){
    var req2 ="var", {x : session1}, function(session2){
            alert("Variance equals: " + data);