Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Unable to use computed value from R as Dimension

Problem: I am unable to use a value computed in R as a dimension in a plot.

Background: I am trying to create a histogram of the residuals from a simple linear regression, similar to this plot:

In order to obtain the residuals, I am using the following expression:

R.ScriptEval('lm(q$medv ~ q$lstat)$residuals', medv, lstat)

Note that both the inputs and the output from R are numeric variables. I used the same script as a Measure expression in a scatterplot and it worked as expected. However, when I attempt to use the script to create a dimension in a histogram or a bar chart, I receive an 'Internal engine error'.

Question: Is there something about the way dimensions are used that would prevent me from using a numeric vector returned from R?

Labels (1)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi Michael,

Yes, this is a known limitation of the current implementation. AAI is not supported for calculated dimensions, or at least it can give unpredictable results. The only possible workaround would be to build the dimensions in the load script.

Regards,

Bas van Reeuwijk

View solution in original post

1 Reply
Anonymous
Not applicable
Author

Hi Michael,

Yes, this is a known limitation of the current implementation. AAI is not supported for calculated dimensions, or at least it can give unpredictable results. The only possible workaround would be to build the dimensions in the load script.

Regards,

Bas van Reeuwijk